diff --git a/e2e/src/create.spec.ts b/e2e/src/create.spec.ts index d01e09b5..69d9675a 100644 --- a/e2e/src/create.spec.ts +++ b/e2e/src/create.spec.ts @@ -13,7 +13,7 @@ const addQuestions = async (page: Page) => { await menuButton.click(); await page.getByRole('button', { name: 'Short Answer' }).click(); await menuButton.click(); - await page.getByRole('button', { name: 'Radio Buttons' }).click(); + await page.getByRole('button', { name: 'Multiple choice' }).click(); } test('Create form from scratch', async ({ page }) => { @@ -41,7 +41,7 @@ test('Add questions', async ({ page }) => { // Create locators for both elements const fields = page.locator('.usa-label'); const element1 = fields.filter({ hasText: 'Field label' }); - const element2 = fields.filter({ hasText: 'Radio group label' }); + const element2 = fields.filter({ hasText: 'Multiple choice question label' }); expect(element1.first()).toBeTruthy(); expect(element2.first()).toBeTruthy(); diff --git a/packages/forms/src/builder/builder.test.ts b/packages/forms/src/builder/builder.test.ts index 8ee7c087..8f262d2a 100644 --- a/packages/forms/src/builder/builder.test.ts +++ b/packages/forms/src/builder/builder.test.ts @@ -292,7 +292,7 @@ describe('form builder', () => { type: 'fieldset', id: 'fieldset-1', data: { - legend: 'Fieldset pattern description', + legend: 'Question set pattern description', patterns: ['element-2'], }, }, @@ -300,7 +300,7 @@ describe('form builder', () => { type: 'radio-group', id: 'radio-group-1', data: { - label: 'Radio group label', + label: 'Multiple choice question label', options: [ { id: 'option-1', label: 'Option 1' }, { id: 'option-2', label: 'Option 2' }, @@ -373,7 +373,7 @@ describe('form builder', () => { type: 'fieldset', id: 'fieldset-1', data: { - legend: 'Fieldset pattern description', + legend: 'Question set pattern description', patterns: ['element-2'], }, }, @@ -381,7 +381,7 @@ describe('form builder', () => { type: 'radio-group', id: 'radio-group-1', data: { - label: 'Radio group label', + label: 'Multiple choice question label', options: [ { id: 'option-1', label: 'Option 1' }, { id: 'option-2', label: 'Option 2' }, @@ -456,7 +456,7 @@ describe('form builder', () => { type: 'fieldset', id: 'fieldset-1', data: { - legend: 'Fieldset pattern description', + legend: 'Question set pattern description', patterns: ['element-2'], }, }, @@ -464,7 +464,7 @@ describe('form builder', () => { type: 'radio-group', id: 'radio-group-1', data: { - label: 'Radio group label', + label: 'Multiple choice question label', options: [ { id: 'option-1', label: 'Option 1' }, { id: 'option-2', label: 'Option 2' }, @@ -476,7 +476,7 @@ describe('form builder', () => { id: newPattern.id, data: { legend: expect.stringMatching( - /^\(\s*Copy\s+\d{1,2}\/\d{1,2}\/\d{4},\s+\d{1,2}:\d{2}:\d{2}\s+[AP]M\)\s*Fieldset pattern description/ + /^\(\s*Copy\s+\d{1,2}\/\d{1,2}\/\d{4},\s+\d{1,2}:\d{2}:\d{2}\s+[AP]M\)\s*Question set pattern description/ ), patterns: ['element-2'], }, @@ -486,7 +486,7 @@ describe('form builder', () => { }); }); - it('copy radio group pattern', () => { + it('copy multiple choice pattern', () => { const initial = createTestBlueprintMultipleFieldsets(); const builder = new BlueprintBuilder(defaultFormConfig, initial); const parentPattern = getPattern(initial, 'page-1'); @@ -535,7 +535,7 @@ describe('form builder', () => { type: 'fieldset', id: 'fieldset-1', data: { - legend: 'Fieldset pattern description', + legend: 'Question set pattern description', patterns: ['element-2'], }, }, @@ -543,7 +543,7 @@ describe('form builder', () => { type: 'radio-group', id: 'radio-group-1', data: { - label: 'Radio group label', + label: 'Multiple choice question label', options: [ { id: 'option-1', label: 'Option 1' }, { id: 'option-2', label: 'Option 2' }, @@ -555,7 +555,7 @@ describe('form builder', () => { id: newPattern.id, data: { label: expect.stringMatching( - /^\(\s*Copy\s+\d{1,2}\/\d{1,2}\/\d{4},\s+\d{1,2}:\d{2}:\d{2}\s+[AP]M\)\s*Radio group label/ + /^\(\s*Copy\s+\d{1,2}\/\d{1,2}\/\d{4},\s+\d{1,2}:\d{2}:\d{2}\s+[AP]M\)\s*Multiple choice question label/ ), options: [ { id: 'option-1', label: 'Option 1' }, @@ -767,7 +767,7 @@ export const createTestBlueprintMultipleFieldsets = () => { type: 'fieldset', id: 'fieldset-1', data: { - legend: 'Fieldset pattern description', + legend: 'Question set pattern description', patterns: ['element-2'], }, } satisfies FieldsetPattern, @@ -775,7 +775,7 @@ export const createTestBlueprintMultipleFieldsets = () => { type: 'radio-group', id: 'radio-group-1', data: { - label: 'Radio group label', + label: 'Multiple choice question label', options: [ { id: 'option-1', label: 'Option 1' }, { id: 'option-2', label: 'Option 2' }, diff --git a/packages/forms/src/patterns/date-of-birth/date-of-birth.test.ts b/packages/forms/src/patterns/date-of-birth/date-of-birth.test.ts index 77204553..44f2466c 100644 --- a/packages/forms/src/patterns/date-of-birth/date-of-birth.test.ts +++ b/packages/forms/src/patterns/date-of-birth/date-of-birth.test.ts @@ -44,7 +44,7 @@ describe('DateOfBirthPattern tests', () => { type: 'date-of-birth', id: 'test', data: { - label: 'Test Date of Birth', + label: 'Test Date of birth', required: true, hint: 'Enter your date of birth', }, @@ -67,7 +67,7 @@ describe('DateOfBirthPattern tests', () => { type: 'date-of-birth', id: 'test', data: { - label: 'Test Date of Birth', + label: 'Test Date of birth', required: true, hint: 'Enter your date of birth', }, @@ -87,7 +87,7 @@ describe('DateOfBirthPattern tests', () => { it('should parse config data correctly', () => { const obj = { - label: 'Test Date of Birth', + label: 'Test Date of birth', required: true, hint: 'Enter your date of birth', }; @@ -97,7 +97,7 @@ describe('DateOfBirthPattern tests', () => { } const result = dateOfBirthConfig.parseConfigData(obj); if (result.success) { - expect(result.data.label).toBe('Test Date of Birth'); + expect(result.data.label).toBe('Test Date of birth'); expect(result.data.required).toBe(true); expect(result.data.hint).toBe('Enter your date of birth'); } else { diff --git a/packages/forms/src/patterns/email-input/email-input.test.ts b/packages/forms/src/patterns/email-input/email-input.test.ts index 69d13416..2d74e563 100644 --- a/packages/forms/src/patterns/email-input/email-input.test.ts +++ b/packages/forms/src/patterns/email-input/email-input.test.ts @@ -9,7 +9,7 @@ describe('EmailInputPattern tests', () => { describe('createEmailSchema', () => { it('should create schema for required email input', () => { const data: EmailInputPattern['data'] = { - label: 'Test Email Input Label', + label: 'Test Email Label', required: true, }; @@ -27,7 +27,7 @@ describe('EmailInputPattern tests', () => { it('should create schema for optional email input', () => { const data: EmailInputPattern['data'] = { - label: 'Test Email Input Label', + label: 'Test Email Label', required: false, }; @@ -46,7 +46,7 @@ describe('EmailInputPattern tests', () => { type: 'email-input', id: 'test', data: { - label: 'Test Email Input Label', + label: 'Test Email Label', required: true, }, }; @@ -68,7 +68,7 @@ describe('EmailInputPattern tests', () => { type: 'email-input', id: 'test', data: { - label: 'Test Email Input Label', + label: 'Test Email Label', required: true, }, }; @@ -87,7 +87,7 @@ describe('EmailInputPattern tests', () => { it('should parse config data correctly', () => { const obj = { - label: 'Test Email Input Label', + label: 'Test Email Label', required: true, }; @@ -96,7 +96,7 @@ describe('EmailInputPattern tests', () => { } const result = emailInputConfig.parseConfigData(obj); if (result.success) { - expect(result.data.label).toBe('Test Email Input Label'); + expect(result.data.label).toBe('Test Email Label'); expect(result.data.required).toBe(true); } else { expect.fail('Unexpected validation failure'); diff --git a/packages/forms/src/patterns/gender-id/gender-id.test.ts b/packages/forms/src/patterns/gender-id/gender-id.test.ts index 9d61c91e..cb2aaea4 100644 --- a/packages/forms/src/patterns/gender-id/gender-id.test.ts +++ b/packages/forms/src/patterns/gender-id/gender-id.test.ts @@ -10,7 +10,7 @@ describe('GenderIdPattern tests', () => { describe('createGenderIdSchema', () => { it('should create schema for required gender identity input', () => { const data: GenderIdPattern['data'] = { - label: 'Test Gender Identity Label', + label: 'Test Gender identity Label', required: true, preferNotToAnswerText: 'Prefer not to share my gender identity', }; @@ -29,7 +29,7 @@ describe('GenderIdPattern tests', () => { it('should create schema for optional gender identity input', () => { const data: GenderIdPattern['data'] = { - label: 'Test Gender Identity Label', + label: 'Test Gender identity Label', required: false, }; @@ -48,7 +48,7 @@ describe('GenderIdPattern tests', () => { id: 'gender-identity-1', type: 'gender-id', data: { - label: 'Test Gender Identity Label', + label: 'Test Gender identity Label', required: true, preferNotToAnswerText: 'Prefer not to share my gender identity', }, @@ -71,7 +71,7 @@ describe('GenderIdPattern tests', () => { id: 'gender-identity-1', type: 'gender-id', data: { - label: 'Test Gender Identity Label', + label: 'Test Gender identity Label', required: true, preferNotToAnswerText: 'Prefer not to share my gender identity', }, @@ -91,7 +91,7 @@ describe('GenderIdPattern tests', () => { it('should parse config data correctly', () => { const obj = { - label: 'Test Gender Identity Label', + label: 'Test Gender identity Label', required: true, hint: 'For example, man, woman, non-binary', preferNotToAnswerText: 'Prefer not to share my gender identity', @@ -102,7 +102,7 @@ describe('GenderIdPattern tests', () => { } const result = genderIdConfig.parseConfigData(obj); if (result.success) { - expect(result.data.label).toBe('Test Gender Identity Label'); + expect(result.data.label).toBe('Test Gender identity Label'); expect(result.data.required).toBe(true); expect(result.data.hint).toBe('For example, man, woman, non-binary'); expect(result.data.preferNotToAnswerText).toBe( diff --git a/packages/forms/src/patterns/social-security-number/social-security-number.test.ts b/packages/forms/src/patterns/social-security-number/social-security-number.test.ts index fad769be..e9e582ab 100644 --- a/packages/forms/src/patterns/social-security-number/social-security-number.test.ts +++ b/packages/forms/src/patterns/social-security-number/social-security-number.test.ts @@ -22,7 +22,7 @@ describe('SocialSecurityNumberPattern tests', () => { const invalidResult = schema.safeParse(invalidInput); expect(invalidResult.success).toBe(false); expect(invalidResult.error?.issues[0].message).toBe( - 'Social Security Number must have exactly 9 digits' + 'Social Security number must have exactly 9 digits' ); }); @@ -43,7 +43,7 @@ describe('SocialSecurityNumberPattern tests', () => { const invalidResult = schema.safeParse(invalidInput); expect(invalidResult.success).toBe(false); expect(invalidResult.error?.issues[0].message).toBe( - 'Social Security Number must have exactly 9 digits' + 'Social Security number must have exactly 9 digits' ); }); @@ -59,7 +59,7 @@ describe('SocialSecurityNumberPattern tests', () => { const shortInputResult = schema.safeParse(shortInput); expect(shortInputResult.success).toBe(false); expect(shortInputResult.error?.issues[0].message).toBe( - 'Social Security Number must have exactly 9 digits' + 'Social Security number must have exactly 9 digits' ); }); @@ -76,7 +76,7 @@ describe('SocialSecurityNumberPattern tests', () => { const result = schema.safeParse(ssn); expect(result.success).toBe(false); expect(result.error?.issues[0].message).toBe( - 'Social Security Number must start with a valid prefix (not 9, 666, or 000)' + 'Social Security number must start with a valid prefix (not 9, 666, or 000)' ); }); }); @@ -96,11 +96,11 @@ describe('SocialSecurityNumberPattern tests', () => { const errorMessage = result.error?.issues[0].message; if (ssn === '555-00-6789') { expect(errorMessage).toBe( - 'Social Security Number must have a valid middle segment (not 00)' + 'Social Security number must have a valid middle segment (not 00)' ); } else if (ssn === '555-12-0000') { expect(errorMessage).toBe( - 'Social Security Number must have a valid suffix (not 0000)' + 'Social Security number must have a valid suffix (not 0000)' ); } }); @@ -154,7 +154,7 @@ describe('SocialSecurityNumberPattern tests', () => { if (!result.success) { expect(result.error).toBeDefined(); expect(result.error?.message).toContain( - 'Social Security Number must have exactly 9 digits' + 'Social Security number must have exactly 9 digits' ); } else { expect.fail('Unexpected validation success');