Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Njwe 2406/scott training results page #3169

Open
wants to merge 22 commits into
base: nextjs
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cypress/e2e/faq-page.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("FAQ Page", () => {
});
it("should show default accordion content", () => {
cy.contains(
"The types of training you will find on this website range from private career schools, non-profit schools, community colleges, vocational schools, literacy programs, short-term occupational and skills training programs, and registered apprenticeships. There are also a select number of higher education programs on this list.",
"The types of training you will find on this website range from private career schools, non-profit schools, community colleges, vocational schools, literacy programs, short-term occupational and skills training programs, and registered apprenticeships. There are also a select number of higher education programs on this list."
).should("exist");
});
});
Expand All @@ -53,7 +53,7 @@ describe("FAQ Page", () => {
});
it("should show correct accordion content", () => {
cy.contains(
"New Jersey Training Explorer is also part of My Career NJ digital portal. You can also access NJ Career Navigator, an AI-powered recommendation engine to help career seekers identify jobs, career changes, and training programs that maximize their economic mobility. This is an authenticated experience that requires users to log in and provide information about their education and work experience.",
"New Jersey Training Explorer is also part of My Career NJ digital portal. You can also access NJ Career Navigator, an AI-powered recommendation engine to help career seekers identify jobs, career changes, and training programs that maximize their economic mobility. This is an authenticated experience that requires users to log in and provide information about their education and work experience."
).should("exist");
});
});
Expand All @@ -66,17 +66,17 @@ describe("FAQ Page", () => {
it("should change the active link when clicked", () => {
cy.get("[data-testid=topic-selector] .dropGroup").eq(1).click();
cy.get(
"[data-testid=topic-selector] .dropGroup.active:nth-child(2) li:first-of-type > button",
"[data-testid=topic-selector] .dropGroup.active:nth-child(2) li:first-of-type > button"
).click();

cy.get(
"[data-testid=topic-selector] .dropGroup.active:nth-child(2) li:first-of-type",
"[data-testid=topic-selector] .dropGroup.active:nth-child(2) li:first-of-type"
).should("have.class", "active");
});
it("should change the url when clicked", () => {
cy.get("[data-testid=topic-selector] .dropGroup").eq(1).click();
cy.get(
"[data-testid=topic-selector] .dropGroup.active:nth-child(2) li:first-of-type > button",
"[data-testid=topic-selector] .dropGroup.active:nth-child(2) li:first-of-type > button"
).click();

//new url should include the #link
Expand Down
92 changes: 46 additions & 46 deletions cypress/e2e/filtering-and-sorting.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe("Filtering", () => {
it("filters by max cost", () => {
it.skip("filters by max cost", () => {
cy.visit("/training/search?q=baking&mockData=baking");
cy.contains("Baking and Pastry").should("exist");
cy.contains('8 results found for "baking"').should("exist");
Expand All @@ -19,169 +19,169 @@ describe("Filtering", () => {
cy.contains('8 results found for "baking"').should("exist");
});

it("filters by training length", () => {
it.skip("filters by training length", () => {
cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=1",
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=1"
);

cy.contains("Rutgers Mini MBA: Digital Marketing").should("exist");
cy.contains(
"Certified Digital Marketing Professional (Voucher Included)",
"Certified Digital Marketing Professional (Voucher Included)"
).should("exist");
cy.contains("Rutgers Virtual Live Mini-MBA: Digital Marketing (5)").should(
"exist",
"exist"
);

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=5",
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=5"
);

cy.contains("Entrepreneurship/Office Equipment Repair Specialist").should(
"exist",
"exist"
);
cy.contains('49 results found for "digital marketing"').should("exist");

cy.contains("Time to Complete").should("exist");
cy.get('[type="checkbox"][name="days"] + label').click();

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=1&days=true",
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=1&days=true"
);

cy.contains("Rutgers Mini MBA: Digital Marketing").should("exist");

cy.contains(
"Certified Digital Marketing Professional (Voucher Included)",
"Certified Digital Marketing Professional (Voucher Included)"
).should("not.exist");

cy.contains("Rutgers Virtual Live Mini-MBA: Digital Marketing (5)").should(
"not.exist",
"not.exist"
);
cy.contains("Entrepreneurship/Office Equipment Repair Specialist").should(
"not.exist",
"not.exist"
);
cy.contains('4 results found for "digital marketing"').should("exist");

cy.get('[type="checkbox"][name="days"] + label').click();

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=1",
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=1"
);

cy.get('[type="checkbox"][name="weeks"] + label').click();

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=1&weeks=true",
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=1&weeks=true"
);

cy.contains("Rutgers Mini MBA: Digital Marketing").should("not.exist");

cy.contains(
"Certified Digital Marketing Professional (Voucher Included)",
"Certified Digital Marketing Professional (Voucher Included)"
).should("not.exist");
cy.contains("Rutgers Virtual Live Mini-MBA: Digital Marketing (5)").should(
"exist",
"exist"
);
cy.contains("Entrepreneurship/Office Equipment Repair Specialist").should(
"not.exist",
"not.exist"
);
cy.contains('20 results found for "digital marketing"').should("exist");

cy.get('[type="checkbox"][name="weeks"] + label').click();

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=1",
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=1"
);

cy.get('[type="checkbox"][name="months"] + label').click();

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=1&months=true",
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=1&months=true"
);

cy.contains("Rutgers Mini MBA: Digital Marketing").should("not.exist");
cy.contains(
"Certified Digital Marketing Professional (Voucher Included)",
"Certified Digital Marketing Professional (Voucher Included)"
).should("exist");
cy.contains("Rutgers Virtual Live Mini-MBA: Digital Marketing (5)").should(
"not.exist",
"not.exist"
);
cy.contains("Entrepreneurship/Office Equipment Repair Specialist").should(
"not.exist",
"not.exist"
);
cy.contains('18 results found for "digital marketing"').should("exist");

cy.get('[type="checkbox"][name="months"] + label').click();

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=1",
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=1"
);

cy.get('[type="checkbox"][name="years"] + label').click();

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=1&years=true",
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=1&years=true"
);

cy.contains("Rutgers Mini MBA: Digital Marketing").should("not.exist");
cy.contains(
"Certified Digital Marketing Professional (Voucher Included)",
"Certified Digital Marketing Professional (Voucher Included)"
).should("not.exist");
cy.contains("Rutgers Virtual Live Mini-MBA: Digital Marketing (5)").should(
"not.exist",
"not.exist"
);
cy.contains("Entrepreneurship/Office Equipment Repair Specialist").should(
"exist",
"exist"
);
cy.contains('7 results found for "digital marketing"').should("exist");
});

it("filters by class format", () => {
it.skip("filters by class format", () => {
cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing",
"/training/search?q=digital%20marketing&mockData=digitalMarketing"
);

cy.contains("Rutgers Mini MBA: Digital Marketing").should("exist");
cy.contains(
"Social Media Marketing with Digital Marketing and Digital Graphics Design Online",
"Social Media Marketing with Digital Marketing and Digital Graphics Design Online"
).should("exist");
cy.contains('49 results found for "digital marketing"').should("exist");

cy.contains("Class Format").should("exist");
cy.get('[type="checkbox"][name="in-person"] + label').click();

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing&inPerson=true",
"/training/search?q=digital%20marketing&mockData=digitalMarketing&inPerson=true"
);

cy.contains("Rutgers Mini MBA: Digital Marketing").should("exist");
cy.contains(
"Social Media Marketing with Digital Marketing and Digital Graphics Design Online",
"Social Media Marketing with Digital Marketing and Digital Graphics Design Online"
).should("not.exist");
cy.contains('42 results found for "digital marketing"').should("exist");

cy.get('[type="checkbox"][name="in-person"] + label').click();

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing",
"/training/search?q=digital%20marketing&mockData=digitalMarketing"
);

cy.get('[type="checkbox"][name="online"] + label').click();

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing&online=true",
"/training/search?q=digital%20marketing&mockData=digitalMarketing&online=true"
);

cy.contains(
"Social Media Marketing with Digital Marketing and Digital Graphics Design Online",
"Social Media Marketing with Digital Marketing and Digital Graphics Design Online"
).should("exist");
cy.contains("Rutgers Mini MBA: Digital Marketing").should("not.exist");
cy.contains('7 results found for "digital marketing"').should("exist");
});

it("filters by location", () => {
it.skip("filters by location", () => {
cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing",
"/training/search?q=digital%20marketing&mockData=digitalMarketing"
);
cy.contains("Rutgers Mini MBA: Digital Marketing").should("exist");
cy.contains('49 results found for "digital marketing"').should("exist");
Expand All @@ -193,7 +193,7 @@ describe("Filtering", () => {
cy.get('select[id="miles"]').blur();

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing&zip=07652&miles=10",
"/training/search?q=digital%20marketing&mockData=digitalMarketing&zip=07652&miles=10"
);

cy.contains("Rutgers Mini MBA: Digital Marketing").should("not.exist");
Expand All @@ -204,49 +204,49 @@ describe("Filtering", () => {
cy.get('input[aria-label="Search by ZIP code"]').blur();

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing",
"/training/search?q=digital%20marketing&mockData=digitalMarketing"
);

cy.contains("Rutgers Mini MBA: Digital Marketing").should("exist");
cy.contains('49 results found for "digital marketing"').should("exist");
});

it("filters by In-Demand Only", () => {
it.skip("filters by In-Demand Only", () => {
cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing",
"/training/search?q=digital%20marketing&mockData=digitalMarketing"
);
cy.contains("Rutgers Mini MBA: Digital Marketing").should("exist");

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=3",
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=3"
);
cy.contains("Visual and Digital Design").should("exist");
cy.contains('49 results found for "digital marketing"').should("exist");

cy.get('input[name="inDemandOnly"] + label').click();

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing&inDemand=true",
"/training/search?q=digital%20marketing&mockData=digitalMarketing&inDemand=true"
);

cy.contains("Rutgers Mini MBA: Digital Marketing").should("exist");

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing&inDemand=true&p=3",
"/training/search?q=digital%20marketing&mockData=digitalMarketing&inDemand=true&p=3"
);
cy.contains("Visual and Digital Design").should("not.exist");
cy.contains('43 results found for "digital marketing"').should("exist");

cy.get('input[name="inDemandOnly"] + label').click();

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing",
"/training/search?q=digital%20marketing&mockData=digitalMarketing"
);

cy.contains("Rutgers Mini MBA: Digital Marketing").should("exist");

cy.visit(
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=3",
"/training/search?q=digital%20marketing&mockData=digitalMarketing&p=3"
);
cy.contains("Visual and Digital Design").should("exist");
cy.contains('49 results found for "digital marketing"').should("exist");
Expand Down Expand Up @@ -329,7 +329,7 @@ describe("Filtering", () => {
.first()
.within(() => {
cy.contains(
"Culinary Opportunity Program for Adults with Developmental Disabilities",
"Culinary Opportunity Program for Adults with Developmental Disabilities"
).should("exist");
});

Expand Down
Loading