From c7fc22487753da1049ef0dbd5cf9198551b47f9d Mon Sep 17 00:00:00 2001 From: Timothy Gonella Date: Wed, 1 Apr 2026 14:58:03 +0100 Subject: [PATCH 1/3] Removed Nested Tags --- .../fines/consolidation/AccountResult.cy.ts | 57 +++++++++---------- .../fines/consolidation/ErrorPage.cy.ts | 7 ++- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/cypress/component/fines/consolidation/AccountResult.cy.ts b/cypress/component/fines/consolidation/AccountResult.cy.ts index ff59bfe565..b25e18421b 100644 --- a/cypress/component/fines/consolidation/AccountResult.cy.ts +++ b/cypress/component/fines/consolidation/AccountResult.cy.ts @@ -51,14 +51,11 @@ const companyResultsTableHeaders = [ 'Ref', ]; +const INDIVIDUAL_TAGS = [CONSOLIDATION_EPIC_TAG, INDIVIDUAL_STORY_TAG]; +const COMPANY_TAGS = [CONSOLIDATION_EPIC_TAG, COMPANY_STORY_TAG]; +const RESULTS_TAB_FUNCTIONALITY_TAGS = [CONSOLIDATION_EPIC_TAG, RESULTS_TAB_FUNCTIONALITY_STORY_TAG]; +const INVALID_RESULTS_TAGS = [CONSOLIDATION_EPIC_TAG, INVALID_RESULTS_STORY_TAG]; const buildTags = (...tags: string[]): string[] => [...tags, CONSOLIDATION_JIRA_LABEL]; -const buildIndividualTags = (...tags: string[]): string[] => - buildTags(CONSOLIDATION_EPIC_TAG, INDIVIDUAL_STORY_TAG, ...tags); -const buildCompanyTags = (...tags: string[]): string[] => buildTags(CONSOLIDATION_EPIC_TAG, COMPANY_STORY_TAG, ...tags); -const buildResultsTabFunctionalityTags = (...tags: string[]): string[] => - buildTags(CONSOLIDATION_EPIC_TAG, RESULTS_TAB_FUNCTIONALITY_STORY_TAG, ...tags); -const buildInvalidResultsTags = (...tags: string[]): string[] => - buildTags(CONSOLIDATION_EPIC_TAG, INVALID_RESULTS_STORY_TAG, ...tags); const normaliseText = (value: string): string => value.replace(/\s+/g, ' ').trim(); type ExpectedResultsOrderRow = { account: string; @@ -183,7 +180,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC1, AC1a, AC1b. should render the individual account results tab with populated mock data', - { tags: buildIndividualTags() }, + { tags: buildTags(...INDIVIDUAL_TAGS) }, () => { setupComponent(); @@ -209,7 +206,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC2, AC2a, AC5a, AC5b, AC5c, AC5d, AC5e, AC5f, AC5g, AC5h, AC5i. should display the individual results columns in the AC order and format populated data', - { tags: buildIndividualTags() }, + { tags: buildTags(...INDIVIDUAL_TAGS) }, () => { defendantAccountResults[0].has_paying_parent_guardian = true; // Set to true to confirm Y is displayed in the relevant cell defendantAccountResults[0].checks = { errors: [], warnings: [] }; //checks should be empty for check boxes to appear @@ -249,7 +246,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC2b, AC2c, AC5b, AC5d, AC5fi, AC5g. should display an em dash for optional or unavailable account data', - { tags: buildIndividualTags() }, + { tags: buildTags(...INDIVIDUAL_TAGS) }, () => { defendantAccountResults.push(createFalseyResult()); @@ -278,7 +275,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC2d, AC2e. should display a maximum of 100 accounts on a single scrollable page with no pagination', - { tags: buildIndividualTags() }, + { tags: buildTags(...INDIVIDUAL_TAGS) }, () => { defendantAccountResults = createMaxResultsMock(); @@ -297,7 +294,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC3. should display individual results in Name, Date of birth, then Account number ascending order', - { tags: buildIndividualTags() }, + { tags: buildTags(...INDIVIDUAL_TAGS) }, () => { defendantAccountResults = [ buildIndividualResult({ @@ -344,7 +341,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC1a, AC1b, AC3, AC3a, AC3b, AC3c. should display the individual over-100 results state with the try adding more information link', - { tags: buildInvalidResultsTags() }, + { tags: buildTags(...INVALID_RESULTS_TAGS) }, () => { defendantAccountResults = createTooManyResultsMock(); @@ -358,7 +355,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC1a, AC1b, AC2, AC2a, AC2b, AC2c. should display the individual no-results state with the check your search link', - { tags: buildInvalidResultsTags() }, + { tags: buildTags(...INVALID_RESULTS_TAGS) }, () => { defendantAccountResults = []; @@ -372,7 +369,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC7. should display warning and error checks beneath the relevant account row', - { tags: buildIndividualTags() }, + { tags: buildTags(...INDIVIDUAL_TAGS) }, () => { setupComponent(); @@ -388,7 +385,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC7a, AC7b. should show only errors when both errors and warnings exist, listing multiple errors as bullets', - { tags: buildIndividualTags() }, + { tags: buildTags(...INDIVIDUAL_TAGS) }, () => { defendantAccountResults = [createMultipleErrorsAndWarningsResult()]; @@ -412,7 +409,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC7c. should display all warnings when multiple warnings apply and no errors exist', - { tags: buildIndividualTags() }, + { tags: buildTags(...INDIVIDUAL_TAGS) }, () => { defendantAccountResults = [createMultipleWarningsResult()]; @@ -439,7 +436,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC1, AC1a, AC1b. should render the company account results tab with populated mock data', - { tags: buildCompanyTags() }, + { tags: buildTags(...COMPANY_TAGS) }, () => { setupComponent({ defendantType: 'company' }); @@ -463,7 +460,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC2, AC2a, AC5a, AC5b, AC5d, AC5e, AC5f, AC5i. should display the company results columns in the AC order and format populated data', - { tags: buildCompanyTags() }, + { tags: buildTags(...COMPANY_TAGS) }, () => { setupComponent({ defendantType: 'company' }); @@ -497,7 +494,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC2b, AC2c, AC5b, AC5d, AC5fi. should display an em dash for unavailable company account data', - { tags: buildCompanyTags() }, + { tags: buildTags(...COMPANY_TAGS) }, () => { defendantAccountResults.push(createCompanyFalseyResult()); @@ -520,7 +517,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC2d, AC2e. should display a maximum of 100 company accounts on a single scrollable page with no pagination', - { tags: buildCompanyTags() }, + { tags: buildTags(...COMPANY_TAGS) }, () => { defendantAccountResults = createCompanyMaxResultsMock(); @@ -536,7 +533,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC3. should display company results in Name, then Account number ascending order', - { tags: buildCompanyTags() }, + { tags: buildTags(...COMPANY_TAGS) }, () => { defendantAccountResults = [ buildCompanyResult({ @@ -575,7 +572,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC1a, AC1b, AC3, AC3a, AC3b, AC3c. should display the company over-100 results state with the try adding more information link', - { tags: buildInvalidResultsTags() }, + { tags: buildTags(...INVALID_RESULTS_TAGS) }, () => { defendantAccountResults = createCompanyTooManyResultsMock(); @@ -589,7 +586,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC1a, AC1b, AC2, AC2a, AC2b, AC2c. should display the company no-results state with the check your search link', - { tags: buildInvalidResultsTags() }, + { tags: buildTags(...INVALID_RESULTS_TAGS) }, () => { defendantAccountResults = []; @@ -603,7 +600,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC7. should display warning and error checks beneath the relevant company account row', - { tags: buildCompanyTags() }, + { tags: buildTags(...COMPANY_TAGS) }, () => { defendantAccountResults[0].checks = { errors: [{ reference: 'CON.ER.4', message: 'Account has days in default' }], @@ -623,7 +620,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC7a, AC7b. should show only errors for company results when both errors and warnings exist, listing multiple errors as bullets', - { tags: buildCompanyTags() }, + { tags: buildTags(...COMPANY_TAGS) }, () => { defendantAccountResults = [createCompanyMultipleErrorsAndWarningsResult()]; @@ -645,7 +642,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC7c. should display all warnings for company results when multiple warnings apply and no errors exist', - { tags: buildCompanyTags() }, + { tags: buildTags(...COMPANY_TAGS) }, () => { defendantAccountResults = [createCompanyMultipleWarningsResult()]; @@ -671,7 +668,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC3, AC3a, AC3b. should show row checkboxes for selectable accounts, hide them for errors, and keep warning rows enabled', - { tags: buildResultsTabFunctionalityTags() }, + { tags: buildTags(...RESULTS_TAB_FUNCTIONALITY_TAGS) }, () => { defendantAccountResults[0].checks = { errors: [], warnings: [] }; defendantAccountResults.push(createMultipleErrorsAndWarningsResult(), createMultipleWarningsResult()); @@ -703,7 +700,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC4, AC4a, AC4b, AC4c, AC5a, AC5b, AC5c. should bulk select and deselect all enabled accounts while excluding accounts with errors', - { tags: buildResultsTabFunctionalityTags() }, + { tags: buildTags(...RESULTS_TAB_FUNCTIONALITY_TAGS) }, () => { defendantAccountResults[0].checks = { errors: [], warnings: [] }; defendantAccountResults.push(createMultipleErrorsAndWarningsResult(), createMultipleWarningsResult()); @@ -744,7 +741,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC6, AC6a, AC6b. should display Add to list above the counter and show a validation error when no accounts are selected', - { tags: buildResultsTabFunctionalityTags() }, + { tags: buildTags(...RESULTS_TAB_FUNCTIONALITY_TAGS) }, () => { defendantAccountResults[0].checks = { errors: [], warnings: [] }; diff --git a/cypress/component/fines/consolidation/ErrorPage.cy.ts b/cypress/component/fines/consolidation/ErrorPage.cy.ts index f33b3cd290..f7dd8aaf8d 100644 --- a/cypress/component/fines/consolidation/ErrorPage.cy.ts +++ b/cypress/component/fines/consolidation/ErrorPage.cy.ts @@ -7,7 +7,8 @@ import { ErrorPageLocators } from 'cypress/shared/selectors/consolidation/ErrorP const CONSOLIDATION_JIRA_LABEL = '@JIRA-LABEL:consolidation'; const CONSOLIDATION_STORY_LABEL = '@JIRA-STORY:PO-2417'; -const buildTags = (...tags: string[]): string[] => [...tags, CONSOLIDATION_JIRA_LABEL, CONSOLIDATION_STORY_LABEL]; +const ERROR_PAGE_TAGS = [CONSOLIDATION_STORY_LABEL]; +const buildTags = (...tags: string[]): string[] => [...tags, CONSOLIDATION_JIRA_LABEL]; describe('FinesConSearchErrorComponent', () => { const setupComponent = (defendantType: 'individual' | 'company') => { @@ -42,7 +43,7 @@ describe('FinesConSearchErrorComponent', () => { }); }; - it('AC2a. displays the individual search error heading and message text', { tags: buildTags() }, () => { + it('AC2a. displays the individual search error heading and message text', { tags: buildTags(...ERROR_PAGE_TAGS) }, () => { setupComponent('individual'); assertHeadingAndIntro(); @@ -52,7 +53,7 @@ describe('FinesConSearchErrorComponent', () => { }); }); - it('AC2b. displays the company search error heading and message text', { tags: buildTags() }, () => { + it('AC2b. displays the company search error heading and message text', { tags: buildTags(...ERROR_PAGE_TAGS) }, () => { setupComponent('company'); assertHeadingAndIntro(); From d01e7f46d7f22a64c9a79472b8aa33ae4ca32694 Mon Sep 17 00:00:00 2001 From: Timothy Gonella Date: Wed, 1 Apr 2026 14:58:03 +0100 Subject: [PATCH 2/3] Removed Nested Tags --- .../fines/consolidation/AccountResult.cy.ts | 57 +++++++++---------- .../fines/consolidation/ErrorPage.cy.ts | 7 ++- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/cypress/component/fines/consolidation/AccountResult.cy.ts b/cypress/component/fines/consolidation/AccountResult.cy.ts index ff59bfe565..b25e18421b 100644 --- a/cypress/component/fines/consolidation/AccountResult.cy.ts +++ b/cypress/component/fines/consolidation/AccountResult.cy.ts @@ -51,14 +51,11 @@ const companyResultsTableHeaders = [ 'Ref', ]; +const INDIVIDUAL_TAGS = [CONSOLIDATION_EPIC_TAG, INDIVIDUAL_STORY_TAG]; +const COMPANY_TAGS = [CONSOLIDATION_EPIC_TAG, COMPANY_STORY_TAG]; +const RESULTS_TAB_FUNCTIONALITY_TAGS = [CONSOLIDATION_EPIC_TAG, RESULTS_TAB_FUNCTIONALITY_STORY_TAG]; +const INVALID_RESULTS_TAGS = [CONSOLIDATION_EPIC_TAG, INVALID_RESULTS_STORY_TAG]; const buildTags = (...tags: string[]): string[] => [...tags, CONSOLIDATION_JIRA_LABEL]; -const buildIndividualTags = (...tags: string[]): string[] => - buildTags(CONSOLIDATION_EPIC_TAG, INDIVIDUAL_STORY_TAG, ...tags); -const buildCompanyTags = (...tags: string[]): string[] => buildTags(CONSOLIDATION_EPIC_TAG, COMPANY_STORY_TAG, ...tags); -const buildResultsTabFunctionalityTags = (...tags: string[]): string[] => - buildTags(CONSOLIDATION_EPIC_TAG, RESULTS_TAB_FUNCTIONALITY_STORY_TAG, ...tags); -const buildInvalidResultsTags = (...tags: string[]): string[] => - buildTags(CONSOLIDATION_EPIC_TAG, INVALID_RESULTS_STORY_TAG, ...tags); const normaliseText = (value: string): string => value.replace(/\s+/g, ' ').trim(); type ExpectedResultsOrderRow = { account: string; @@ -183,7 +180,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC1, AC1a, AC1b. should render the individual account results tab with populated mock data', - { tags: buildIndividualTags() }, + { tags: buildTags(...INDIVIDUAL_TAGS) }, () => { setupComponent(); @@ -209,7 +206,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC2, AC2a, AC5a, AC5b, AC5c, AC5d, AC5e, AC5f, AC5g, AC5h, AC5i. should display the individual results columns in the AC order and format populated data', - { tags: buildIndividualTags() }, + { tags: buildTags(...INDIVIDUAL_TAGS) }, () => { defendantAccountResults[0].has_paying_parent_guardian = true; // Set to true to confirm Y is displayed in the relevant cell defendantAccountResults[0].checks = { errors: [], warnings: [] }; //checks should be empty for check boxes to appear @@ -249,7 +246,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC2b, AC2c, AC5b, AC5d, AC5fi, AC5g. should display an em dash for optional or unavailable account data', - { tags: buildIndividualTags() }, + { tags: buildTags(...INDIVIDUAL_TAGS) }, () => { defendantAccountResults.push(createFalseyResult()); @@ -278,7 +275,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC2d, AC2e. should display a maximum of 100 accounts on a single scrollable page with no pagination', - { tags: buildIndividualTags() }, + { tags: buildTags(...INDIVIDUAL_TAGS) }, () => { defendantAccountResults = createMaxResultsMock(); @@ -297,7 +294,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC3. should display individual results in Name, Date of birth, then Account number ascending order', - { tags: buildIndividualTags() }, + { tags: buildTags(...INDIVIDUAL_TAGS) }, () => { defendantAccountResults = [ buildIndividualResult({ @@ -344,7 +341,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC1a, AC1b, AC3, AC3a, AC3b, AC3c. should display the individual over-100 results state with the try adding more information link', - { tags: buildInvalidResultsTags() }, + { tags: buildTags(...INVALID_RESULTS_TAGS) }, () => { defendantAccountResults = createTooManyResultsMock(); @@ -358,7 +355,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC1a, AC1b, AC2, AC2a, AC2b, AC2c. should display the individual no-results state with the check your search link', - { tags: buildInvalidResultsTags() }, + { tags: buildTags(...INVALID_RESULTS_TAGS) }, () => { defendantAccountResults = []; @@ -372,7 +369,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC7. should display warning and error checks beneath the relevant account row', - { tags: buildIndividualTags() }, + { tags: buildTags(...INDIVIDUAL_TAGS) }, () => { setupComponent(); @@ -388,7 +385,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC7a, AC7b. should show only errors when both errors and warnings exist, listing multiple errors as bullets', - { tags: buildIndividualTags() }, + { tags: buildTags(...INDIVIDUAL_TAGS) }, () => { defendantAccountResults = [createMultipleErrorsAndWarningsResult()]; @@ -412,7 +409,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC7c. should display all warnings when multiple warnings apply and no errors exist', - { tags: buildIndividualTags() }, + { tags: buildTags(...INDIVIDUAL_TAGS) }, () => { defendantAccountResults = [createMultipleWarningsResult()]; @@ -439,7 +436,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC1, AC1a, AC1b. should render the company account results tab with populated mock data', - { tags: buildCompanyTags() }, + { tags: buildTags(...COMPANY_TAGS) }, () => { setupComponent({ defendantType: 'company' }); @@ -463,7 +460,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC2, AC2a, AC5a, AC5b, AC5d, AC5e, AC5f, AC5i. should display the company results columns in the AC order and format populated data', - { tags: buildCompanyTags() }, + { tags: buildTags(...COMPANY_TAGS) }, () => { setupComponent({ defendantType: 'company' }); @@ -497,7 +494,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC2b, AC2c, AC5b, AC5d, AC5fi. should display an em dash for unavailable company account data', - { tags: buildCompanyTags() }, + { tags: buildTags(...COMPANY_TAGS) }, () => { defendantAccountResults.push(createCompanyFalseyResult()); @@ -520,7 +517,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC2d, AC2e. should display a maximum of 100 company accounts on a single scrollable page with no pagination', - { tags: buildCompanyTags() }, + { tags: buildTags(...COMPANY_TAGS) }, () => { defendantAccountResults = createCompanyMaxResultsMock(); @@ -536,7 +533,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC3. should display company results in Name, then Account number ascending order', - { tags: buildCompanyTags() }, + { tags: buildTags(...COMPANY_TAGS) }, () => { defendantAccountResults = [ buildCompanyResult({ @@ -575,7 +572,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC1a, AC1b, AC3, AC3a, AC3b, AC3c. should display the company over-100 results state with the try adding more information link', - { tags: buildInvalidResultsTags() }, + { tags: buildTags(...INVALID_RESULTS_TAGS) }, () => { defendantAccountResults = createCompanyTooManyResultsMock(); @@ -589,7 +586,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC1a, AC1b, AC2, AC2a, AC2b, AC2c. should display the company no-results state with the check your search link', - { tags: buildInvalidResultsTags() }, + { tags: buildTags(...INVALID_RESULTS_TAGS) }, () => { defendantAccountResults = []; @@ -603,7 +600,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC7. should display warning and error checks beneath the relevant company account row', - { tags: buildCompanyTags() }, + { tags: buildTags(...COMPANY_TAGS) }, () => { defendantAccountResults[0].checks = { errors: [{ reference: 'CON.ER.4', message: 'Account has days in default' }], @@ -623,7 +620,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC7a, AC7b. should show only errors for company results when both errors and warnings exist, listing multiple errors as bullets', - { tags: buildCompanyTags() }, + { tags: buildTags(...COMPANY_TAGS) }, () => { defendantAccountResults = [createCompanyMultipleErrorsAndWarningsResult()]; @@ -645,7 +642,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC7c. should display all warnings for company results when multiple warnings apply and no errors exist', - { tags: buildCompanyTags() }, + { tags: buildTags(...COMPANY_TAGS) }, () => { defendantAccountResults = [createCompanyMultipleWarningsResult()]; @@ -671,7 +668,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC3, AC3a, AC3b. should show row checkboxes for selectable accounts, hide them for errors, and keep warning rows enabled', - { tags: buildResultsTabFunctionalityTags() }, + { tags: buildTags(...RESULTS_TAB_FUNCTIONALITY_TAGS) }, () => { defendantAccountResults[0].checks = { errors: [], warnings: [] }; defendantAccountResults.push(createMultipleErrorsAndWarningsResult(), createMultipleWarningsResult()); @@ -703,7 +700,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC4, AC4a, AC4b, AC4c, AC5a, AC5b, AC5c. should bulk select and deselect all enabled accounts while excluding accounts with errors', - { tags: buildResultsTabFunctionalityTags() }, + { tags: buildTags(...RESULTS_TAB_FUNCTIONALITY_TAGS) }, () => { defendantAccountResults[0].checks = { errors: [], warnings: [] }; defendantAccountResults.push(createMultipleErrorsAndWarningsResult(), createMultipleWarningsResult()); @@ -744,7 +741,7 @@ describe('FinesConConsolidateAccComponent - Account Results', () => { it( 'AC6, AC6a, AC6b. should display Add to list above the counter and show a validation error when no accounts are selected', - { tags: buildResultsTabFunctionalityTags() }, + { tags: buildTags(...RESULTS_TAB_FUNCTIONALITY_TAGS) }, () => { defendantAccountResults[0].checks = { errors: [], warnings: [] }; diff --git a/cypress/component/fines/consolidation/ErrorPage.cy.ts b/cypress/component/fines/consolidation/ErrorPage.cy.ts index f33b3cd290..f7dd8aaf8d 100644 --- a/cypress/component/fines/consolidation/ErrorPage.cy.ts +++ b/cypress/component/fines/consolidation/ErrorPage.cy.ts @@ -7,7 +7,8 @@ import { ErrorPageLocators } from 'cypress/shared/selectors/consolidation/ErrorP const CONSOLIDATION_JIRA_LABEL = '@JIRA-LABEL:consolidation'; const CONSOLIDATION_STORY_LABEL = '@JIRA-STORY:PO-2417'; -const buildTags = (...tags: string[]): string[] => [...tags, CONSOLIDATION_JIRA_LABEL, CONSOLIDATION_STORY_LABEL]; +const ERROR_PAGE_TAGS = [CONSOLIDATION_STORY_LABEL]; +const buildTags = (...tags: string[]): string[] => [...tags, CONSOLIDATION_JIRA_LABEL]; describe('FinesConSearchErrorComponent', () => { const setupComponent = (defendantType: 'individual' | 'company') => { @@ -42,7 +43,7 @@ describe('FinesConSearchErrorComponent', () => { }); }; - it('AC2a. displays the individual search error heading and message text', { tags: buildTags() }, () => { + it('AC2a. displays the individual search error heading and message text', { tags: buildTags(...ERROR_PAGE_TAGS) }, () => { setupComponent('individual'); assertHeadingAndIntro(); @@ -52,7 +53,7 @@ describe('FinesConSearchErrorComponent', () => { }); }); - it('AC2b. displays the company search error heading and message text', { tags: buildTags() }, () => { + it('AC2b. displays the company search error heading and message text', { tags: buildTags(...ERROR_PAGE_TAGS) }, () => { setupComponent('company'); assertHeadingAndIntro(); From d275f62030efa8a33a5aac002fff50f9f35433d3 Mon Sep 17 00:00:00 2001 From: Timothy Gonella Date: Wed, 1 Apr 2026 16:20:52 +0100 Subject: [PATCH 3/3] Prettier fix --- .../fines/consolidation/ErrorPage.cy.ts | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/cypress/component/fines/consolidation/ErrorPage.cy.ts b/cypress/component/fines/consolidation/ErrorPage.cy.ts index f7dd8aaf8d..e0d9722e50 100644 --- a/cypress/component/fines/consolidation/ErrorPage.cy.ts +++ b/cypress/component/fines/consolidation/ErrorPage.cy.ts @@ -43,23 +43,31 @@ describe('FinesConSearchErrorComponent', () => { }); }; - it('AC2a. displays the individual search error heading and message text', { tags: buildTags(...ERROR_PAGE_TAGS) }, () => { - setupComponent('individual'); + it( + 'AC2a. displays the individual search error heading and message text', + { tags: buildTags(...ERROR_PAGE_TAGS) }, + () => { + setupComponent('individual'); - assertHeadingAndIntro(); - cy.get(ErrorPageLocators.bulletItems).then(($items) => { - const items = [...$items].map((item) => item.textContent?.replace(/\s+/g, ' ').trim()); - expect(items).to.deep.equal(['account number, or', 'National Insurance number, or', 'advanced search']); - }); - }); + assertHeadingAndIntro(); + cy.get(ErrorPageLocators.bulletItems).then(($items) => { + const items = [...$items].map((item) => item.textContent?.replace(/\s+/g, ' ').trim()); + expect(items).to.deep.equal(['account number, or', 'National Insurance number, or', 'advanced search']); + }); + }, + ); - it('AC2b. displays the company search error heading and message text', { tags: buildTags(...ERROR_PAGE_TAGS) }, () => { - setupComponent('company'); + it( + 'AC2b. displays the company search error heading and message text', + { tags: buildTags(...ERROR_PAGE_TAGS) }, + () => { + setupComponent('company'); - assertHeadingAndIntro(); - cy.get(ErrorPageLocators.bulletItems).then(($items) => { - const items = [...$items].map((item) => item.textContent?.replace(/\s+/g, ' ').trim()); - expect(items).to.deep.equal(['account number, or', 'advanced search']); - }); - }); + assertHeadingAndIntro(); + cy.get(ErrorPageLocators.bulletItems).then(($items) => { + const items = [...$items].map((item) => item.textContent?.replace(/\s+/g, ' ').trim()); + expect(items).to.deep.equal(['account number, or', 'advanced search']); + }); + }, + ); });