Skip to content

Commit

Permalink
test: update to remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tlebon committed Jan 23, 2024
1 parent b155eb9 commit 18d9cd3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions src/script/component/OpenWireButtons.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(<OpenWireButtons {...defaultParams} />));
res.getByText('openWithApp');
Expand All @@ -46,15 +46,15 @@ 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 () => {
const res = render(withTheme(<OpenWireButtons {...defaultParams} />));
res.getByText('openWithApp');
res.getByText('openWithBrowser');
res.getByText('downloadApp');
expect(res.getByText('openWithApp')).toBeTruthy();
expect(res.getByText('openWithBrowser')).toBeTruthy();
expect(res.getByText('downloadApp')).toBeTruthy();
});

it('only show join in webapp when in a self hosted env', async () => {
Expand Down
10 changes: 5 additions & 5 deletions src/script/page/ConversationJoin.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand Down
10 changes: 5 additions & 5 deletions src/script/page/UserProfile.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class UserProfilePage extends TestPage<UserProfileProps> {
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(
{
Expand All @@ -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(
{
Expand All @@ -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(
{
Expand Down

0 comments on commit 18d9cd3

Please sign in to comment.