correct and complete unit tests in Front-End

This commit is contained in:
Laurent GAY
2025-06-11 18:49:45 +02:00
parent 2fa54e8282
commit 533ecbdbba
67 changed files with 1900 additions and 203 deletions

View File

@@ -70,7 +70,10 @@ describe("Reset page", () => {
const wrapper = generateWrapper();
expect(wrapper.router).toBe(router);
expect(wrapper.findAll('input[type="password"').length).toBe(2);
expect(wrapper.html()).toMatchSnapshot();
const labels = wrapper.findAll("label");
expect(labels.length).toBe(2);
expect(labels.at(0).text()).toBe("Password");
expect(labels.at(1).text()).toBe("Password (confirmation)");
});
it("shows error if token is invalid", async () => {
@@ -98,7 +101,6 @@ describe("Reset page", () => {
expect(wrapper.find(".o-notification--danger").text()).toContain(
"The token you provided is invalid"
);
expect(wrapper.html()).toMatchSnapshot();
});
it("redirects to homepage if token is valid", async () => {