From bd12c50b714bd57f824902ded4e05fee1d25d920 Mon Sep 17 00:00:00 2001 From: Timothy Le Bon Date: Tue, 23 Jan 2024 14:50:33 +0100 Subject: [PATCH] test: update to remove warnings --- src/script/component/OpenWireButtons.test.tsx | 6 +++--- src/script/page/ConversationJoin.test.tsx | 10 +++++----- src/script/page/UserProfile.test.tsx | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/script/component/OpenWireButtons.test.tsx b/src/script/component/OpenWireButtons.test.tsx index 322e829789..f34ed9d51c 100644 --- a/src/script/component/OpenWireButtons.test.tsx +++ b/src/script/component/OpenWireButtons.test.tsx @@ -35,7 +35,7 @@ describe('OpenWireButtons', () => { }; describe('on mobile', () => { it('shows open app & direct download', () => { - jest.spyOn(Runtime, 'isMobileOS').and.returnValue(true); + jest.spyOn(Runtime, 'isMobileOS').mockReturnValue(true); const res = render(withTheme()); res.getByText('openWithApp'); @@ -46,8 +46,8 @@ describe('OpenWireButtons', () => { describe('on desktop', () => { beforeEach(() => { - jest.spyOn(Runtime, 'isMobileOS').and.returnValue(false); - jest.spyOn(Runtime, 'isMacOS').and.returnValue(true); + jest.spyOn(Runtime, 'isMobileOS').mockReturnValue(false); + jest.spyOn(Runtime, 'isMacOS').mockReturnValue(true); }); it('shows open app, webapp & direct download on MacOS', async () => { diff --git a/src/script/page/ConversationJoin.test.tsx b/src/script/page/ConversationJoin.test.tsx index 59128981df..41c8703ed6 100644 --- a/src/script/page/ConversationJoin.test.tsx +++ b/src/script/page/ConversationJoin.test.tsx @@ -77,7 +77,7 @@ describe('ConversationJoin', () => { describe('on mobile', () => { it('shows open app & direct download', async () => { - jest.spyOn(Runtime, 'isMobileOS').and.returnValue(true); + jest.spyOn(Runtime, 'isMobileOS').mockReturnValue(true); const validateConversationJoinSpy = jest.fn(() => Promise.resolve()); const conversationJoinPage = new ConversationJoinPage( @@ -105,8 +105,8 @@ describe('ConversationJoin', () => { describe('on desktop', () => { it('shows open app, webapp & direct download on MacOS', async () => { - jest.spyOn(Runtime, 'isMobileOS').and.returnValue(false); - jest.spyOn(Runtime, 'isMacOS').and.returnValue(true); + jest.spyOn(Runtime, 'isMobileOS').mockReturnValue(false); + jest.spyOn(Runtime, 'isMacOS').mockReturnValue(true); const validateConversationJoinSpy = jest.fn(() => Promise.resolve()); const conversationJoinPage = new ConversationJoinPage( @@ -132,8 +132,8 @@ describe('ConversationJoin', () => { }); it('shows open app, webapp & website download on non-MacOS', async () => { - jest.spyOn(Runtime, 'isMobileOS').and.returnValue(false); - jest.spyOn(Runtime, 'isMacOS').and.returnValue(false); + jest.spyOn(Runtime, 'isMobileOS').mockReturnValue(false); + jest.spyOn(Runtime, 'isMacOS').mockReturnValue(false); const validateConversationJoinSpy = jest.fn(() => Promise.resolve()); const conversationJoinPage = new ConversationJoinPage( diff --git a/src/script/page/UserProfile.test.tsx b/src/script/page/UserProfile.test.tsx index 9f460d9068..722080e864 100644 --- a/src/script/page/UserProfile.test.tsx +++ b/src/script/page/UserProfile.test.tsx @@ -51,7 +51,7 @@ class UserProfilePage extends TestPage { describe('UserProfile', () => { describe('on mobile', () => { it('shows open app & direct download', async () => { - jest.spyOn(Runtime, 'isMobileOS').and.returnValue(true); + jest.spyOn(Runtime, 'isMobileOS').mockReturnValue(true); const conversationJoinPage = new UserProfilePage( { @@ -71,8 +71,8 @@ describe('UserProfile', () => { describe('on desktop', () => { it('shows open app, webapp & direct download on MacOS', async () => { - jest.spyOn(Runtime, 'isMobileOS').and.returnValue(false); - jest.spyOn(Runtime, 'isMacOS').and.returnValue(true); + jest.spyOn(Runtime, 'isMobileOS').mockReturnValue(false); + jest.spyOn(Runtime, 'isMacOS').mockReturnValue(true); const conversationJoinPage = new UserProfilePage( { @@ -90,8 +90,8 @@ describe('UserProfile', () => { }); it('shows open app, webapp & website download on non-MacOS', async () => { - jest.spyOn(Runtime, 'isMobileOS').and.returnValue(false); - jest.spyOn(Runtime, 'isMacOS').and.returnValue(false); + jest.spyOn(Runtime, 'isMobileOS').mockReturnValue(false); + jest.spyOn(Runtime, 'isMacOS').mockReturnValue(false); const conversationJoinPage = new UserProfilePage( {