Skip to content

Commit

Permalink
Merge pull request #5793 from flexion/createAndServePaperPetition-fix
Browse files Browse the repository at this point in the history
Create and serve paper petition fix
  • Loading branch information
jimlerza authored Feb 27, 2025
2 parents d6258ec + 391b149 commit 0002a6f
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions cypress/helpers/fileAPetition/create-and-serve-paper-petition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,22 +172,31 @@ export function createAndServePaperPetition(

cy.get('[data-testid="tab-drafts"] > .button-text').click();

cy.get('[data-testid="docket-entry-description-0"]').should(
'have.text',
const expectedDescriptions = [
'Notice of Attachments in the Nature of Evidence',
);
cy.get('[data-testid="docket-entry-description-1"]').should(
'have.text',
'Order',
);
cy.get('[data-testid="docket-entry-description-2"]').should(
'have.text',
'Order',
);
cy.get('[data-testid="docket-entry-description-3"]').should(
'have.text',
'Order to Show Cause',
);
];

cy.get('[data-testid^="docket-entry-description-"]').should($els => {
const actualDescriptions = Array.from($els).map(el => el.textContent);

expect(actualDescriptions).to.have.length(expectedDescriptions.length);

expectedDescriptions.forEach(expected => {
const expectedCount = expectedDescriptions.filter(
desc => desc === expected,
).length;
const actualCount = actualDescriptions.filter(
desc => desc === expected,
).length;
expect(
actualCount,
`Should have ${expectedCount} occurrence(s) of "${expected}"`,
).to.equal(expectedCount);
});
});

cy.get('[data-testid="tab-docket-record"]').click();

Expand Down

0 comments on commit 0002a6f

Please sign in to comment.