test(matrix): fix bootstrap password mock typing

This commit is contained in:
Gustavo Madeira Santana
2026-04-15 13:09:00 -04:00
parent 229eb72cf6
commit ed28df48a4

View File

@@ -5,7 +5,7 @@ import type { MatrixCryptoBootstrapApi, MatrixRawEvent } from "./types.js";
function createBootstrapperDeps() {
return {
getUserId: vi.fn(async () => "@bot:example.org"),
getPassword: vi.fn(() => "super-secret-password"),
getPassword: vi.fn<() => string | undefined>(() => "super-secret-password"),
getDeviceId: vi.fn(() => "DEVICE123"),
verificationManager: {
trackVerificationRequest: vi.fn(),
@@ -279,7 +279,7 @@ describe("MatrixCryptoBootstrapper", () => {
it("does not mutate secret storage before forced repair fails on password UIA without a password", async () => {
const deps = createBootstrapperDeps();
deps.getPassword = vi.fn(() => undefined);
deps.getPassword = vi.fn<() => string | undefined>(() => undefined);
const bootstrapCrossSigning = vi.fn<
({
authUploadDeviceSigningKeys,