Mocking PasswordScorer.scorePassword to reduce risk of flakiness (#33591)

Co-authored-by: David Baker <dbkr@users.noreply.github.com>
This commit is contained in:
rbondesson
2026-05-22 15:29:55 +00:00
committed by GitHub
co-authored by David Baker
parent 8e42cf7298
commit 53fba7ff71
@@ -14,6 +14,16 @@ import { mocked } from "jest-mock";
import ChangePassword from "../../../../../src/components/views/settings/ChangePassword";
import { stubClient } from "../../../../test-utils";
jest.mock("../../../../../src/utils/PasswordScorer", () => ({
scorePassword: jest.fn(() => ({
score: 4,
feedback: {
warning: "",
suggestions: [],
},
})),
}));
describe("<ChangePassword />", () => {
it("renders expected fields", () => {
const onFinished = jest.fn();