Mocking PasswordScorer.scorePassword to reduce risk of flakiness (#33591)
Co-authored-by: David Baker <dbkr@users.noreply.github.com>
This commit is contained in:
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 ChangePassword from "../../../../../src/components/views/settings/ChangePassword";
|
||||||
import { stubClient } from "../../../../test-utils";
|
import { stubClient } from "../../../../test-utils";
|
||||||
|
|
||||||
|
jest.mock("../../../../../src/utils/PasswordScorer", () => ({
|
||||||
|
scorePassword: jest.fn(() => ({
|
||||||
|
score: 4,
|
||||||
|
feedback: {
|
||||||
|
warning: "",
|
||||||
|
suggestions: [],
|
||||||
|
},
|
||||||
|
})),
|
||||||
|
}));
|
||||||
|
|
||||||
describe("<ChangePassword />", () => {
|
describe("<ChangePassword />", () => {
|
||||||
it("renders expected fields", () => {
|
it("renders expected fields", () => {
|
||||||
const onFinished = jest.fn();
|
const onFinished = jest.fn();
|
||||||
|
|||||||
Reference in New Issue
Block a user