Skip to content

Commit

Permalink
Added additional e2e test to validate the ratio order
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-c-dfe committed Jul 29, 2024
1 parent 186a16f commit 8831b7e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ public async Task<List<NavigationLink>> GetNavigationLinks()
},
new List<RatioRequirement>()
{
new() { RatioRequirementName = "Level 2 ratio requirements" }
new() { RatioRequirementName = "Level 2 Ratio Requirements", FullAndRelevantForLevel3After2014 = true },
new() { RatioRequirementName = "Level 3 Ratio Requirements", FullAndRelevantForLevel3After2014 = true },
new() { RatioRequirementName = "Level 6 Ratio Requirements" },
new() { RatioRequirementName = "Unqualified Ratio Requirements", FullAndRelevantForLevel3After2014 = true },
}
));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@model Dfe.EarlyYearsQualification.Web.Models.RatioRowModel

<tr class="govuk-table__row ">
<tr class="govuk-table__row ratio-row" id="@{@Model.LevelText}_row">
<td class="govuk-table__cell">
<div class="govuk-!-static-margin-top-6 govuk-!-static-margin-bottom-6">
<b class="govuk-!-text-align-left">@Model.LevelText</b>
<b class="govuk-!-text-align-left ratio-heading" id="@{@Model.LevelText}_heading">@Model.LevelText</b>
</div>
</td>
<td class="govuk-table__cell">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,31 @@ describe("A spec used to test the qualification details page", () => {

cy.get("#ratio-heading").should("contain.text", "Test ratio heading");
cy.get("#ratio-heading + p[class='govuk-body']").should("contain.text", "This is the ratio text");

cy.get("#requirements-heading").should("contain.text", "Test requirements heading");
cy.get("#requirements-heading + p[class='govuk-body']").should("contain.text", "This is the requirements text");

cy.get("#check-another-qualification-link").should("contain.text", "Check another qualification");
})

it("Checks the order of the ratios on the page", () => {
cy.visit("/qualifications/qualification-details/eyq-240");

cy.get(".ratio-row").should('have.length', 4);
cy.get(".ratio-heading").eq(0).should("contain.text", "Level 3");
cy.get(".ratio-heading").eq(1).should("contain.text", "Level 2");
cy.get(".ratio-heading").eq(2).should("contain.text", "Unqualified");
cy.get(".ratio-heading").eq(3).should("contain.text", "Level 6");

// Phase Banner uses govuk-tag also hence index starting at 1
cy.get(".govuk-tag").eq(1).should("contain.text", "Approved");
cy.get(".govuk-tag").eq(2).should("contain.text", "Approved");
cy.get(".govuk-tag").eq(3).should("contain.text", "Approved");
cy.get(".govuk-tag").eq(4).should("contain.text", "Not Approved");

cy.get(".govuk-tag").eq(1).should("have.class", "govuk-tag--green");
cy.get(".govuk-tag").eq(2).should("have.class", "govuk-tag--green");
cy.get(".govuk-tag").eq(3).should("have.class", "govuk-tag--green");
cy.get(".govuk-tag").eq(4).should("have.class", "govuk-tag--red");
})
})

0 comments on commit 8831b7e

Please sign in to comment.