Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions playground/e2e/Buttons.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Platform } from 'react-native';
import Utils from './Utils';
import TestIDs from '../src/testIDs';

Expand All @@ -22,14 +23,21 @@ describe('Buttons', () => {
});

it(':android: should not effect left buttons when hiding back button', async () => {
await elementById(TestIDs.TOGGLE_BACK).tap();
await expect(elementById(TestIDs.LEFT_BUTTON)).toBeVisible();
await expect(elementById(TestIDs.TEXTUAL_LEFT_BUTTON)).toBeVisible();
await expect(elementById(TestIDs.BACK_BUTTON)).toBeVisible();

await elementById(TestIDs.TOGGLE_BACK).tap();
await expect(elementById(TestIDs.LEFT_BUTTON)).toBeVisible();
await expect(elementById(TestIDs.TEXTUAL_LEFT_BUTTON)).toBeVisible();
// Jest mock runs with Platform.OS === 'ios'; this test asserts Android-only topBar behavior.
const platform = Platform.OS;
Platform.OS = 'android';
try {
await elementById(TestIDs.TOGGLE_BACK).tap();
await expect(elementById(TestIDs.LEFT_BUTTON)).toBeVisible();
await expect(elementById(TestIDs.TEXTUAL_LEFT_BUTTON)).toBeVisible();
await expect(elementById(TestIDs.BACK_BUTTON)).toBeVisible();

await elementById(TestIDs.TOGGLE_BACK).tap();
await expect(elementById(TestIDs.LEFT_BUTTON)).toBeVisible();
await expect(elementById(TestIDs.TEXTUAL_LEFT_BUTTON)).toBeVisible();
} finally {
Platform.OS = platform;
}
});
it('sets right buttons', async () => {
await expect(elementById(TestIDs.BUTTON_ONE)).toBeVisible();
Expand Down