Skip to content

Commit

Permalink
fix: reset is not require as the email is generated
Browse files Browse the repository at this point in the history
  • Loading branch information
ieow committed Dec 17, 2024
1 parent 0b7b931 commit 6e75ea8
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions tests/sfaImport.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import test from "node:test";
import { tssLib as tssLibDKLS } from "@toruslabs/tss-dkls-lib";
import { tssLib as tssLibFROST } from "@toruslabs/tss-frost-lib";

import { AsyncStorage, MemoryStorage, TssLibType, TssShareType, WEB3AUTH_NETWORK } from "../src";
import { criticalResetAccount, generateRandomEmail, loginWithSFA, newCoreKitLogInInstance } from "./setup";
import { MemoryStorage, TssLibType, TssShareType, WEB3AUTH_NETWORK } from "../src";
import { generateRandomEmail, loginWithSFA, newCoreKitLogInInstance } from "./setup";

type ImportKeyTestVariable = {
manualSync?: boolean;
Expand All @@ -26,17 +26,9 @@ export const ImportSFATest = async (testVariable: ImportKeyTestVariable) => {
});
}

async function resetAccount(email: string) {
const kit = await newCoreKitInstance(email);
await criticalResetAccount(kit);
await kit.logout();
await new AsyncStorage(kit._storageKey, storageInstance).resetStore();
}

test(`import sfa key and recover tss key : ${testVariable.manualSync}`, async function (t) {
const afterTest = async () => {
await resetAccount(testVariable.email);
};

await t.test("#recover Tss key using 2 factors key, import tss key to new oauth login", async function () {
const sfaResult = await loginWithSFA({
network: WEB3AUTH_NETWORK.DEVNET,
Expand Down Expand Up @@ -85,7 +77,6 @@ export const ImportSFATest = async (testVariable: ImportKeyTestVariable) => {

});

await afterTest();
t.afterEach(function () {
return console.info("finished running recovery test");
});
Expand Down

0 comments on commit 6e75ea8

Please sign in to comment.