test: 💍 Remove warnings about timers not beeing mocked (#540)

The jest.advanceTimersToNextTimer() is not needed by the tests, they pass without it.
The reason the warnings was not seen before was because we used an older version
of jest (26) before. Now with NX we use 27.
This commit is contained in:
Andreas Eriksson 2021-11-15 23:48:04 +01:00 committed by GitHub
parent d24347f272
commit 826e198cc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 0 additions and 48 deletions

View File

@ -191,8 +191,6 @@ describe('useCalendar(child)', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ id: 2 }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()
@ -222,8 +220,6 @@ describe('useCalendar(child)', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ id: 2 }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()

View File

@ -223,8 +223,6 @@ describe('useChildList()', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual(echildrenCache)
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()
@ -264,8 +262,6 @@ describe('useChildList()', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual(echildrenCache)
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()

View File

@ -176,8 +176,6 @@ describe('useClassmates(child)', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ id: 2 }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()
@ -207,8 +205,6 @@ describe('useClassmates(child)', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ id: 2 }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()

View File

@ -174,8 +174,6 @@ describe('useEtjanstChildren()', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ id: 2 }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()
@ -205,8 +203,6 @@ describe('useEtjanstChildren()', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ id: 2 }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()

View File

@ -172,8 +172,6 @@ describe('useMenu(child)', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ id: 2 }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()
@ -202,8 +200,6 @@ describe('useMenu(child)', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ id: 2 }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()

View File

@ -172,8 +172,6 @@ describe('useNews(child)', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ id: 2 }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()
@ -202,8 +200,6 @@ describe('useNews(child)', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ id: 2 }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()

View File

@ -192,8 +192,6 @@ describe('useNewsDetails(child, newsItem)', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual({ ...cached })
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()
@ -223,8 +221,6 @@ describe('useNewsDetails(child, newsItem)', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual({ ...cached })
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()

View File

@ -176,8 +176,6 @@ describe('useNotifications(child)', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ id: 2 }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()
@ -207,8 +205,6 @@ describe('useNotifications(child)', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ id: 2 }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()

View File

@ -192,8 +192,6 @@ describe('useSchedule(child, from, to)', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ id: 2 }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()
@ -223,8 +221,6 @@ describe('useSchedule(child, from, to)', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ id: 2 }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()

View File

@ -178,8 +178,6 @@ describe('useSkola24Children()', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ personGuid: '2' }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()
@ -209,8 +207,6 @@ describe('useSkola24Children()', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ personGuid: '2' }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()

View File

@ -191,8 +191,6 @@ describe('useTimetable(child, week, year, lang)', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ id: 2 }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()
@ -222,8 +220,6 @@ describe('useTimetable(child, week, year, lang)', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual([{ id: 2 }])
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()

View File

@ -162,8 +162,6 @@ describe('useUser()', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual({ id: 2 })
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()
@ -192,8 +190,6 @@ describe('useUser()', () => {
expect(result.current.status).toEqual('loading')
expect(result.current.data).toEqual({ id: 2 })
jest.advanceTimersToNextTimer()
await waitForNextUpdate()
await waitForNextUpdate()
await waitForNextUpdate()