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

[MAPA-422] Tela de resposta do match bem sucedido com voluntária #58

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
935a4de
chore: installs react-toastify
vivianedias Dec 2, 2024
a875885
feat: configures react-toastify
vivianedias Dec 2, 2024
0c26f60
feat: adds func to format phone number
vivianedias Dec 2, 2024
4cad4ef
feat: adds icons for match page
vivianedias Dec 2, 2024
3f55f57
feat: adds match page
vivianedias Dec 2, 2024
c7a5704
feat: creates VolunteerCard comp
vivianedias Dec 3, 2024
840b422
test: adds tests to VolunteerCard
vivianedias Dec 3, 2024
1a774da
refactor: add volunteer info in arr before rendering
vivianedias Dec 3, 2024
1e996c6
feat: adds DuplicatedMatchRequest comp
vivianedias Dec 4, 2024
c5b4e43
feat: adds VolunteerNotFound comp
vivianedias Dec 4, 2024
32b0f58
feat: adds different iterations for match page
vivianedias Dec 4, 2024
79012c4
feat: removes illustration from mobile
vivianedias Dec 4, 2024
964fdd2
feat: creates func to fetch support request data
vivianedias Dec 5, 2024
05cde5a
feat: fetches from support request dinamically and separates concerns
vivianedias Dec 5, 2024
0500a05
feat: adds custom title for NoMatchFound comp
vivianedias Dec 9, 2024
8b723c5
feat: finalizes match page happy path
vivianedias Jan 3, 2025
eff72fa
feat: adds conditional text treatment on match not found
vivianedias Jan 3, 2025
8fc49f1
test: adds tests on SupportRequestStatus comps
vivianedias Jan 3, 2025
2614064
fix: removes "use server" from internal comps
vivianedias Jan 3, 2025
73fa281
test: adds more tests to MatchFound and MatchNotFound
vivianedias Jan 3, 2025
e9c794d
feat(handle-request): always returns supportRequestId
vivianedias Jan 4, 2025
fe0d857
test(handle-request): updates tests after changing return
vivianedias Jan 4, 2025
12fa01e
feat: updates path to redirect after successful register
vivianedias Jan 4, 2025
1a0133c
feat(VolunteerCard): updates btn row on mobile/desktop
vivianedias Jan 4, 2025
5c73a19
test(e2e): updates tests after pedido-acolhimento page is included on…
vivianedias Jan 4, 2025
987b453
test: removes seed from integration tests pipeline
vivianedias Jan 4, 2025
96a70f5
test: rollback changes o insert-support-requests bc of pipeline errors
vivianedias Jan 4, 2025
1aca395
Merge branch 'main' of github.com:mapadoacolhimento/cadastro-msr into…
vivianedias Jan 4, 2025
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
3 changes: 0 additions & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ jobs:
- name: Push current migrations to test database
run: pnpm db:push

- name: Seed db
run: pnpm db:seed

- name: Run integration tests
run: pnpm run test:int:ci

Expand Down
77 changes: 7 additions & 70 deletions cypress/e2e/App.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ describe("When MSR does not meet the criteria", () => {
});

describe("Submit the form", () => {
it("should redirect to `cadastro-finalizado` when handle-request return both support requests with match status", () => {
it("should redirect to `pedido-acolhimeto` with correct url after successfull submit", () => {
cy.intercept("POST", "/handle-request", {
statusCode: 200,
body: {
psychological: { status: "waiting_contact" },
legal: { status: "waiting_contact" },
psychological: { supportRequestId: 1 },
legal: { supportRequestId: 2 },
},
});

Expand All @@ -227,72 +227,9 @@ describe("Submit the form", () => {

cy.fillAllSteps(supportTypes);

cy.url().should("include", "/cadastro-finalizado");
});

it("should redirect to `acolhimento-andamento` when handle-request return the support request with status `duplicated`", () => {
cy.intercept("POST", "/handle-request", {
statusCode: 200,
body: {
psychological: { status: "duplicated" },
},
});

cy.visit("/");
cy.goThroughHomePage();

cy.fillAllSteps({ psychological: "Acolhimento psicológico" });

cy.url().should("include", "/acolhimento-andamento");
});

it("should redirect to `cadastro-finalizado` when handle-request return the support request with match status", () => {
cy.intercept("POST", "/handle-request", {
statusCode: 200,
body: {
legal: { status: "waiting_contact" },
},
});

cy.visit("/");
cy.goThroughHomePage();

cy.fillAllSteps({ legal: "Acolhimento jurídico" });

cy.url().should("include", "/cadastro-finalizado");
});

it("should redirect to `cadastro-finalizado` when handle-request return at least one support request with match status", () => {
cy.intercept("POST", "/handle-request", {
statusCode: 200,
body: {
psychological: { status: "duplicated" },
legal: [{ status: "waiting_contact" }],
},
});

cy.visit("/");
cy.goThroughHomePage();

cy.fillAllSteps(supportTypes);

cy.url().should("include", "/cadastro-finalizado");
});

it("should redirect to `acolhimento-andamento` when handle-request return both support requests with status `duplicated`", () => {
cy.intercept("POST", "/handle-request", {
statusCode: 200,
body: {
psychological: { status: "duplicated" },
legal: { status: "duplicated" },
},
});

cy.visit("/");
cy.goThroughHomePage();

cy.fillAllSteps(supportTypes);

cy.url().should("include", "/acolhimento-andamento");
cy.url().should(
"include",
"/pedido-acolhimento?psychologicalSupportRequestId=1&legalSupportRequestId=2"
);
});
});
26 changes: 7 additions & 19 deletions cypress/e2e/a11y.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe("Accessbility", () => {
});
});

describe("Acolhimento andamento", () => {
describe("Pedido acolhimento", () => {
sizes.forEach((size) => {
describe(
size.name,
Expand All @@ -88,27 +88,15 @@ describe("Accessbility", () => {
viewportWidth: size.viewportWidth,
},
() => {
it("should pass the accessibility test", () => {
cy.visit("/acolhimento-andamento");
it("MatchFound -> should pass the accessibility test", () => {
cy.visit(
"/pedido-acolhimento?psychologicalSupportRequestId=1&legalSupportRequestId=2"
);
cy.injectAxe();
cy.checkA11y(null, null, terminalLog);
});
}
);
});
});

describe("Cadastro finalizado", () => {
sizes.forEach((size) => {
describe(
size.name,
{
viewportHeight: size.viewportHeight,
viewportWidth: size.viewportWidth,
},
() => {
it("should pass the accessibility test", () => {
cy.visit("/cadastro-finalizado");
it("MatchNotFound -> should pass the accessibility test", () => {
cy.visit("/pedido-acolhimento?legalSupportRequestId=2");
cy.injectAxe();
cy.checkA11y(null, null, terminalLog);
});
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"react-dom": "^18.3.1",
"react-input-mask": "3.0.0-alpha.2",
"react-select": "^5.8.0",
"react-toastify": "^10.0.6",
"yup": "^1.4.0"
},
"devDependencies": {
Expand Down
Loading
Loading