feat(ext/setup): hand off completion to fullscreen vault tab (P2)
After successful device registration (state.configPushed = true), the wizard now opens vault.html in a new tab and closes the setup tab. Both create-new and attach-existing flows funnel through the same finishSetup() handler. Closing the setup tab is best-effort -- chrome.tabs.remove failures don't block the vault open. Add src/__stubs__/relicario_wasm.stub.ts + vitest.config alias so setup.ts can be imported in unit tests without the runtime WASM file. Exclude the stubs dir from the webpack/tsc build in tsconfig.json.
This commit is contained in:
13
extension/src/__stubs__/relicario_wasm.stub.ts
Normal file
13
extension/src/__stubs__/relicario_wasm.stub.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// Stub for the runtime-only WASM module. Used by vitest so that modules
|
||||
// importing relicario_wasm.js can be loaded in a Node/happy-dom environment.
|
||||
// Individual tests that exercise WASM calls should mock the relevant exports.
|
||||
|
||||
export default async function init(): Promise<void> {}
|
||||
export const unlock = (): never => { throw new Error('wasm stub: unlock not mocked'); };
|
||||
export const lock = (): void => {};
|
||||
export const manifest_encrypt = (): never => { throw new Error('wasm stub: manifest_encrypt not mocked'); };
|
||||
export const manifest_decrypt = (): never => { throw new Error('wasm stub: manifest_decrypt not mocked'); };
|
||||
export const settings_encrypt = (): never => { throw new Error('wasm stub: settings_encrypt not mocked'); };
|
||||
export const default_vault_settings_json = (): string => '{}';
|
||||
export const embed_image_secret = (): never => { throw new Error('wasm stub: embed_image_secret not mocked'); };
|
||||
export const register_device = (): never => { throw new Error('wasm stub: register_device not mocked'); };
|
||||
Reference in New Issue
Block a user