mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
Modify behavior of insufficient data indicators for admin data items. Now we show indicators in line with the admin data item descriptions to indicate which items are missing data
This commit is contained in:
parent
7c0794f261
commit
deaf13c976
15 changed files with 251 additions and 62 deletions
|
|
@ -0,0 +1,77 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe AdminDataPresenter do
|
||||
let(:school) { School.find_by_slug 'milford-high-school' }
|
||||
let(:academic_year) { AcademicYear.find_by_range '2021-22' }
|
||||
let(:measure_1A_i) { Measure.find_by_measure_id '1A-i' }
|
||||
let(:measure_1A_iii) { Measure.find_by_measure_id '1A-iii' }
|
||||
describe '#item_description' do
|
||||
before :each do
|
||||
Rails.application.load_seed
|
||||
end
|
||||
|
||||
after :each do
|
||||
DatabaseCleaner.clean
|
||||
end
|
||||
|
||||
context 'When the presenter is based on measure 1A-1' do
|
||||
it 'returns a list of survey prompts for teacher survey items' do
|
||||
expect(AdminDataPresenter.new(measure_id: measure_1A_i.measure_id, admin_data_items: measure_1A_i.admin_data_items,
|
||||
has_sufficient_data: true, school:, academic_year:).item_descriptions).to eq [
|
||||
'Percentage teachers with 5+ years of experience', 'Percentage teachers National Board certified', 'Percentage teachers teaching in area of licensure'
|
||||
]
|
||||
end
|
||||
context 'When the measure is missing all admin data values' do
|
||||
it 'if it lacks sufficient data, it shows a warning ' do
|
||||
expect(AdminDataPresenter.new(measure_id: measure_1A_i.measure_id, admin_data_items: measure_1A_i.admin_data_items,
|
||||
has_sufficient_data: false, school:, academic_year:).sufficient_data?).to eq false
|
||||
end
|
||||
end
|
||||
|
||||
context 'When the measure has at least one admin data value' do
|
||||
it 'if it lacks sufficient data, it doesnt show a warning ' do
|
||||
expect(AdminDataPresenter.new(measure_id: measure_1A_i.measure_id, admin_data_items: measure_1A_i.admin_data_items,
|
||||
has_sufficient_data: true, school:, academic_year:).sufficient_data?).to eq true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'When the presenter is based on measure 1A-iii' do
|
||||
it 'returns a message hiding the actual prompts. Instead it presents a message telling the user they can ask for more information' do
|
||||
expect(AdminDataPresenter.new(measure_id: measure_1A_iii.measure_id, admin_data_items: measure_1A_iii.admin_data_items,
|
||||
has_sufficient_data: true, school:, academic_year:).item_descriptions).to eq [
|
||||
'Percent teacher returning (excluding retirement)', 'Percent teachers with 10+ days absent'
|
||||
]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#descriptions_and_availibility' do
|
||||
before :each do
|
||||
Rails.application.load_seed
|
||||
end
|
||||
|
||||
after :each do
|
||||
DatabaseCleaner.clean
|
||||
end
|
||||
context 'when there are any matching values for admin data items' do
|
||||
before do
|
||||
admin_data_item = measure_1A_i.admin_data_items.first
|
||||
create(:admin_data_value, admin_data_item:, school:, academic_year:)
|
||||
end
|
||||
it 'returns a list of admin data items and whether there is a matching value' do
|
||||
expect(
|
||||
AdminDataPresenter.new(
|
||||
measure_id: measure_1A_i.measure_id, admin_data_items: measure_1A_i.admin_data_items, has_sufficient_data: true, school:, academic_year:
|
||||
).descriptions_and_availability
|
||||
).to eq [
|
||||
DataAvailability.new('a-exp-i1', 'Percentage teachers with 5+ years of experience', true),
|
||||
DataAvailability.new('a-exp-i2', 'Percentage teachers National Board certified', false),
|
||||
DataAvailability.new('a-exp-i3', 'Percentage teachers teaching in area of licensure', false)
|
||||
]
|
||||
end
|
||||
end
|
||||
context 'when there are NO matching values for admin data items' do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,8 +1,11 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe TeacherSurveyPresenter do
|
||||
let(:school) { School.first }
|
||||
let(:academic_year) { AcademicYear.first }
|
||||
let(:measure_1A_i) { Measure.find_by_measure_id '1A-i' }
|
||||
let(:measure_1B_i) { Measure.find_by_measure_id '1B-i' }
|
||||
|
||||
describe '#item_description' do
|
||||
before :each do
|
||||
Rails.application.load_seed
|
||||
|
|
@ -15,7 +18,7 @@ describe TeacherSurveyPresenter do
|
|||
context 'When the presenter is based on measure 1A-1' do
|
||||
it 'returns a list of survey prompts for teacher survey items' do
|
||||
expect(TeacherSurveyPresenter.new(measure_id: measure_1A_i.measure_id, survey_items: measure_1A_i.teacher_survey_items,
|
||||
has_sufficient_data: true).item_descriptions).to eq [
|
||||
has_sufficient_data: true, school:, academic_year:).item_descriptions).to eq [
|
||||
'Given your preparation for teaching how comfortable are you teaching at the grade-level you have been assigned?',
|
||||
'How prepared are you for teaching the topics that you are expected to teach in your assignment?',
|
||||
'How confident are you in working with the student body at your school?'
|
||||
|
|
@ -26,7 +29,7 @@ describe TeacherSurveyPresenter do
|
|||
context 'When the presenter is based on measure 1B-i' do
|
||||
it 'returns a message hiding the actual prompts. Instead it presents a message telling the user they can ask for more information' do
|
||||
expect(TeacherSurveyPresenter.new(measure_id: measure_1B_i.measure_id, survey_items: measure_1B_i.teacher_survey_items,
|
||||
has_sufficient_data: true).item_descriptions).to eq [
|
||||
has_sufficient_data: true, school:, academic_year:).item_descriptions).to eq [
|
||||
'Items available upon request to MCIEA.'
|
||||
]
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue