fix(fe/topbar): fix test failure
This commit is contained in:
parent
e4e53b15f2
commit
bcc04f2067
2 changed files with 6 additions and 3 deletions
|
@ -7,10 +7,10 @@ export function alertMsg(msg: string) {
|
|||
}
|
||||
|
||||
export function confirmMsg(msg: string): boolean {
|
||||
try {
|
||||
if (confirm != null) {
|
||||
return confirm(msg);
|
||||
} catch (e) {
|
||||
console.log(`${msg}: yes (confirm is not implemented)`);
|
||||
} else {
|
||||
console.warn(`${msg}: return yes (confirm is not implemented)`);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,9 @@ import { UploadEntry, UploadState } from "../../worker/interface";
|
|||
|
||||
|
||||
describe("TopBar", () => {
|
||||
// stub confirm
|
||||
window.confirm = (message?: string): boolean => {return true;};
|
||||
|
||||
test("logout as visitor without sharing", async () => {
|
||||
const mockWorkerClass = mock(MockWorker);
|
||||
const mockWorker = instance(mockWorkerClass);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue