1
0
mirror of https://github.com/bitwarden/browser synced 2026-03-02 03:21:19 +00:00

update SingleUserScene to accept results from bitwarden/server#6909

This commit is contained in:
Matt Gibson
2026-01-27 12:48:23 -08:00
parent 232535d6f7
commit 13975354b6
2 changed files with 13 additions and 3 deletions

View File

@@ -1,10 +1,19 @@
import { KdfType } from "@bitwarden/key-management";
import { EncString } from "@bitwarden/sdk-internal";
import { UserId } from "@bitwarden/user-core";
import { Scene } from "../scene";
import { SceneTemplate } from "./scene-template";
type SceneResult = UserId;
type SceneResult = {
userId: UserId;
kdf: KdfType;
kdfIterations?: number;
key: EncString;
privateKey: EncString;
publicKey: string;
};
type UpParams = {
email: string;
emailVerified?: boolean;

View File

@@ -4,8 +4,7 @@ import { SceneTemplate } from "./scene-templates/scene-template";
* A Scene contains logic to set up and tear down data for a test on the server.
* It is created by providing a Scene Template, which contains the arguments the server requires to create the data.
*
* Scenes are `Disposable`, meaning they must be used with the `using` keyword and will be automatically torn down when disposed.
* Options exist to modify this behavior.
* Scenes are intended to be initialized through the {@link Play.scene} method.
*
* - {@link SceneOptions.noDown}: Useful for setting up data then using codegen to create tests that use the data. Remember to tear down the data manually.
* - {@link SceneOptions.downAfterAll}: Useful for expensive setups that you want to share across all tests in a worker or for writing acts.
@@ -28,10 +27,12 @@ export class Scene<UpParams = unknown, Returns = void> {
return this._template;
}
/** The template arguments used to initialize this scene */
get upArgs(): UpParams {
return this.template.upArgs;
}
/** The value returned from the seeder API for this scene */
get returnValue(): Returns {
if (!this.inited) {
throw new Error("Scene must be initialized before accessing returnValue");