Update prop type & documentation for HistoryVisibleBanner and VM. (#31545)
* docs: Update documentation for HistoryVisibleBanner and VM. * docs: Improve documentation for `HistoryVisibleBanner`, second pass. * docs: Move documentation to prop types over FC. Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * fix: Simplify type for `HistoryVisibleBannerViewModel` `threadId`. * docs: Apply suggestions from code review Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --------- Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
This commit is contained in:
@@ -54,7 +54,7 @@ describe("HistoryVisibleBannerViewModel", () => {
|
||||
});
|
||||
|
||||
it("should not show the banner in unencrypted rooms", () => {
|
||||
const vm = new HistoryVisibleBannerViewModel({ room });
|
||||
const vm = new HistoryVisibleBannerViewModel({ room, threadId: null });
|
||||
expect(vm.getSnapshot().visible).toBe(false);
|
||||
});
|
||||
|
||||
@@ -76,7 +76,7 @@ describe("HistoryVisibleBannerViewModel", () => {
|
||||
}),
|
||||
]);
|
||||
|
||||
const vm = new HistoryVisibleBannerViewModel({ room });
|
||||
const vm = new HistoryVisibleBannerViewModel({ room, threadId: null });
|
||||
expect(vm.getSnapshot().visible).toBe(false);
|
||||
});
|
||||
|
||||
@@ -99,7 +99,7 @@ describe("HistoryVisibleBannerViewModel", () => {
|
||||
}),
|
||||
]);
|
||||
|
||||
const vm = new HistoryVisibleBannerViewModel({ room });
|
||||
const vm = new HistoryVisibleBannerViewModel({ room, threadId: null });
|
||||
expect(vm.getSnapshot().visible).toBe(false);
|
||||
vm.dispose();
|
||||
});
|
||||
@@ -145,7 +145,7 @@ describe("HistoryVisibleBannerViewModel", () => {
|
||||
}),
|
||||
]);
|
||||
|
||||
const vm = new HistoryVisibleBannerViewModel({ room });
|
||||
const vm = new HistoryVisibleBannerViewModel({ room, threadId: null });
|
||||
expect(vm.getSnapshot().visible).toBe(true);
|
||||
await vm.onClose();
|
||||
expect(vm.getSnapshot().visible).toBe(false);
|
||||
|
||||
Reference in New Issue
Block a user