Skip to content

Commit

Permalink
refactor(suite-native): conditional jest test condition negated
Browse files Browse the repository at this point in the history
  • Loading branch information
PeKne committed Dec 17, 2024
1 parent cfb7ac2 commit 9055e1e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
12 changes: 4 additions & 8 deletions suite-common/test-utils/src/conditionalDescribe.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
export const conditionalDescribe = (
skipCondition: boolean,
title: string,
fn: jest.EmptyFunction,
) => {
if (skipCondition) {
describe.skip(title, fn);
} else {
export const conditionalDescribe = (condition: boolean, title: string, fn: jest.EmptyFunction) => {
if (condition) {
describe(title, fn);
} else {
describe.skip(title, fn);
}
};
2 changes: 1 addition & 1 deletion suite-native/app/e2e/tests/deeplinkPopup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const openUriScheme = (url: string, platformToOpen: 'android') => {
});
};

conditionalDescribe(device.getPlatform() !== 'android', 'Deeplink connect popup.', () => {
conditionalDescribe(device.getPlatform() === 'android', 'Deeplink connect popup.', () => {
beforeAll(async () => {
await new Promise(resolve => {
server = http.createServer((req, res) => {
Expand Down
2 changes: 1 addition & 1 deletion suite-native/app/e2e/tests/deviceSettings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
restartApp,
} from '../utils';

conditionalDescribe(device.getPlatform() !== 'android', 'Device settings', () => {
conditionalDescribe(device.getPlatform() === 'android', 'Device settings', () => {
beforeAll(async () => {
await prepareTrezorEmulator();
await openApp({ newInstance: true });
Expand Down
2 changes: 1 addition & 1 deletion suite-native/app/e2e/tests/onboardAndConnect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { onCoinEnablingInit } from '../pageObjects/coinEnablingActions';
const platform = device.getPlatform();

conditionalDescribe(
device.getPlatform() !== 'android',
device.getPlatform() === 'android',
'Go through onboarding and connect Trezor.',
() => {
beforeAll(async () => {
Expand Down
2 changes: 1 addition & 1 deletion suite-native/app/e2e/tests/send.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const signTransactionAndSendIt = async () => {
await onSendOutputsReview.clickSendTransaction();
};

conditionalDescribe(device.getPlatform() !== 'android', 'Send transaction flow.', () => {
conditionalDescribe(device.getPlatform() === 'android', 'Send transaction flow.', () => {
beforeAll(async () => {
await prepareTrezorEmulator();
await openApp({ newInstance: true });
Expand Down

0 comments on commit 9055e1e

Please sign in to comment.