From 76c6e029a5c8dc17ecb8d696ee0e2368c41e23f3 Mon Sep 17 00:00:00 2001 From: Tom Ratcliffe Date: Thu, 4 Apr 2024 11:52:33 +0100 Subject: [PATCH] Fix incidental console error spy that was unneeded --- public/app/features/playlist/PlaylistNewPage.test.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/public/app/features/playlist/PlaylistNewPage.test.tsx b/public/app/features/playlist/PlaylistNewPage.test.tsx index af155f54ac2..ad69e3e7056 100644 --- a/public/app/features/playlist/PlaylistNewPage.test.tsx +++ b/public/app/features/playlist/PlaylistNewPage.test.tsx @@ -39,15 +39,11 @@ function getTestContext({ name, interval, items }: Partial = {}) { } describe('PlaylistNewPage', () => { - beforeEach(() => { - jest.spyOn(console, 'error').mockImplementation(() => {}); - }); - describe('when mounted', () => { - it('then header should be correct', () => { + it('then header should be correct', async () => { getTestContext(); - expect(screen.getByRole('heading', { name: /new playlist/i })).toBeInTheDocument(); + expect(await screen.findByRole('heading', { name: /new playlist/i })).toBeInTheDocument(); }); });