-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[APM] Fix some warnings logged in APM tests #52487
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,8 @@ | |
*/ | ||
|
||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import { delay, tick } from '../utils/testHelpers'; | ||
import { render, wait } from '@testing-library/react'; | ||
import { delay } from '../utils/testHelpers'; | ||
import { useFetcher } from './useFetcher'; | ||
import { KibanaCoreContext } from '../../../observability/public/context/kibana_core'; | ||
import { LegacyCoreStart } from 'kibana/public'; | ||
|
@@ -76,7 +76,8 @@ describe('when simulating race condition', () => { | |
|
||
it('should render "Hello from Peter" after 200ms', async () => { | ||
jest.advanceTimersByTime(200); | ||
await tick(); | ||
|
||
await wait(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice 👍 Wouldn't mind if you removed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is fixed now. |
||
|
||
expect(renderSpy).lastCalledWith({ | ||
data: 'Hello from Peter', | ||
|
@@ -87,7 +88,7 @@ describe('when simulating race condition', () => { | |
|
||
it('should render "Hello from Peter" after 600ms', async () => { | ||
jest.advanceTimersByTime(600); | ||
await tick(); | ||
await wait(); | ||
|
||
expect(renderSpy).lastCalledWith({ | ||
data: 'Hello from Peter', | ||
|
@@ -98,7 +99,7 @@ describe('when simulating race condition', () => { | |
|
||
it('should should NOT have rendered "Hello from John" at any point', async () => { | ||
jest.advanceTimersByTime(600); | ||
await tick(); | ||
await wait(); | ||
|
||
expect(renderSpy).not.toHaveBeenCalledWith({ | ||
data: 'Hello from John', | ||
|
@@ -109,7 +110,7 @@ describe('when simulating race condition', () => { | |
|
||
it('should send and receive calls in the right order', async () => { | ||
jest.advanceTimersByTime(600); | ||
await tick(); | ||
await wait(); | ||
|
||
expect(requestCallOrder).toEqual([ | ||
['request', 'John', 500], | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, much better. I wonder if the lack of proper cleanup caused bugs in the past?