mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 15:23:33 +00:00
[PM-4561] Migrate Browser Account Settings (#6886)
* Move Account Settings * Add Another Test * Refactor Tests * Update Notification Bar to Get Value From Global * Also Migrate Disable Context Menu * Add Explanation
This commit is contained in:
@@ -17,6 +17,20 @@ describe("MigrationBuilder", () => {
|
||||
}
|
||||
}
|
||||
|
||||
class TestMigratorWithInstanceMethod extends Migrator<0, 1> {
|
||||
private async instanceMethod(helper: MigrationHelper, value: string) {
|
||||
await helper.set("test", value);
|
||||
}
|
||||
|
||||
async migrate(helper: MigrationHelper): Promise<void> {
|
||||
await this.instanceMethod(helper, "migrate");
|
||||
}
|
||||
|
||||
async rollback(helper: MigrationHelper): Promise<void> {
|
||||
await this.instanceMethod(helper, "rollback");
|
||||
}
|
||||
}
|
||||
|
||||
let sut: MigrationBuilder<number>;
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -114,4 +128,9 @@ describe("MigrationBuilder", () => {
|
||||
expect(rollback).not.toBeCalled();
|
||||
});
|
||||
});
|
||||
|
||||
it("should be able to call instance methods", async () => {
|
||||
const helper = new MigrationHelper(0, mock(), mock());
|
||||
await sut.with(TestMigratorWithInstanceMethod, 0, 1).migrate(helper);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user