1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 10:43:35 +00:00

[PM-12704] - fix loading state for send list (#11264)

* fix loading state for send service

* fix test

* fix test and service
This commit is contained in:
Jordan Aasen
2024-09-27 04:38:50 -07:00
committed by GitHub
parent ff57c72df5
commit 739c76a24f
5 changed files with 19 additions and 7 deletions

View File

@@ -62,9 +62,15 @@ describe("SendItemsService", () => {
it("should update loading$ when sends are loading", (done) => {
const sendsLoading$ = new Subject<void>();
(service as any)._sendsLoading$ = sendsLoading$;
let sendLoadingIndex = 0;
service.loading$.subscribe((loading) => {
expect(loading).toBe(true);
done();
if (sendLoadingIndex === 0) {
expect(loading).toBe(true);
sendLoadingIndex++;
} else {
expect(loading).toBe(false);
done();
}
});
sendsLoading$.next();