FAIL src/correspondence-gmail-import.test.tsx (8.128 s) ● correspondence Gmail import › linked refresh completion lifetime › an automatic refresh finishing after leaving cannot start follow-up reads expect(jest.fn()).toHaveBeenCalledTimes(expected) Expected number of calls: 2 Received number of calls: 3 365 | const reads = mockedApi.get.mock.calls.length; 366 | await act(async () => { write.resolve({ data: { ...refreshed, imported: 1 } }); }); > 367 | expect(mockedApi.get).toHaveBeenCalledTimes(reads); | ^ 368 | expect(screen.queryByRole('alert')).not.toBeInTheDocument(); 369 | }); 370 | at Object.toHaveBeenCalledTimes (src/correspondence-gmail-import.test.tsx:367:29) ● correspondence Gmail import › linked refresh completion lifetime › manual refresh feedback respects a leave boundary expect(element).not.toBeInTheDocument() expected document not to contain element, found
instead 386 | view.rerender(dialog(42, false)); 387 | await act(async () => { write.reject(new Error('obsolete refresh failure')); }); > 388 | expect(screen.queryByText(translations.en.correspondenceRefreshLinkedFailed)).not.toBeInTheDocument(); | ^ 389 | } else { 390 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: 'nb' })); }); 391 | await act(async () => { write.resolve({ data: refreshed }); }); at toBeInTheDocument (src/correspondence-gmail-import.test.tsx:388:91) ● correspondence Gmail import › linked refresh completion lifetime › manual refresh feedback respects a language boundary Unable to find an element with the text: Tilknyttede Gmail-tråder er allerede oppdatert.. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. Ignored nodes: comments, script, style