1
0
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:
Justin Baur
2023-11-17 09:20:42 -05:00
committed by GitHub
parent e84e02c441
commit 5b1717fd41
12 changed files with 528 additions and 42 deletions

View File

@@ -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);
});
});