mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 19:23:52 +00:00
[AC-2436] Fix flashing unassigned items banner (#8689)
* Fix flashing banner for users who shouldn't see it * Emit the right value the first time * simplify further * restore comment
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { MockProxy, mock } from "jest-mock-extended";
|
||||
import { firstValueFrom, skip } from "rxjs";
|
||||
import { firstValueFrom } from "rxjs";
|
||||
|
||||
import { FakeStateProvider, mockAccountServiceWith } from "@bitwarden/common/spec";
|
||||
import { UserId } from "@bitwarden/common/types/guid";
|
||||
@@ -44,10 +44,8 @@ describe("UnassignedItemsBanner", () => {
|
||||
showBanner.nextState(undefined);
|
||||
|
||||
const sut = sutFactory();
|
||||
// skip first value so we get the recomputed value after the server call
|
||||
expect(await firstValueFrom(sut.showBanner$.pipe(skip(1)))).toBe(true);
|
||||
// Expect to have updated local state
|
||||
expect(await firstValueFrom(showBanner.state$)).toBe(true);
|
||||
|
||||
expect(await firstValueFrom(sut.showBanner$)).toBe(true);
|
||||
expect(apiService.getShowUnassignedCiphersBanner).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user