Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
feat(app): setting don't show > if external link (#70)
Browse files Browse the repository at this point in the history
#### What this PR does / why we need it:

- Setting row if external link, don't show ">".
- Also added playwright tests
  • Loading branch information
fuxingloh authored Jul 6, 2023
1 parent 8e171d6 commit 60a097a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 19 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ jobs:
strategy:
fail-fast: false
matrix:
project: [chromium]
shardIndex: [1, 2]
shardTotal: [2]
steps:
Expand Down Expand Up @@ -167,7 +166,7 @@ jobs:

- name: playwright test
working-directory: app
run: yarn playwright test --project=${{ matrix.project }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
run: yarn playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}

- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: always()
Expand Down
1 change: 1 addition & 0 deletions app/app/keychain/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default function TabsLayout(): JSX.Element {
tabPress: () => haptic.selectionAsync(),
}),
options: {
tabBarTestID: `/keychain/${props.route}`,
title: props.title,
tabBarIcon: ({ color }) => <IconSet name={props.icon} size={24} color={color} />,
},
Expand Down
8 changes: 8 additions & 0 deletions app/app/keychain/settings/about/design.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { expect, test } from '@playwright/test';

test('should go to Settings -> Design System ', async ({ page, baseURL }) => {
await page.goto('/');
await page.getByTestId('/keychain/settings').click();
await page.getByTestId('/keychain/settings/about/design').click();
await expect(page).toHaveURL(`${baseURL}/keychain/settings/about/design`);
});
4 changes: 2 additions & 2 deletions app/app/keychain/settings/about/design.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function DesignSystemPage(): JSX.Element {
<>
<Stack.Screen
options={{
title: 'Design',
title: 'Design System',
headerLargeTitle: true,
headerStyle: tailwind('bg-stone-900'),
headerLargeStyle: tailwind('bg-stone-900'),
Expand All @@ -24,7 +24,7 @@ export default function DesignSystemPage(): JSX.Element {
/>
<SafeAreaView style={tailwind('flex-1 bg-stone-900')}>
<ScrollView>
<Section title="KEYCHAIN DESIGN SYSTEM">
<Section title="LEVAIN KEYCHAIN DESIGN SYSTEM">
<Text style={tailwind('text-base text-stone-200')}>
A collection of open source rules, principles, and constraints that govern how we design and build Levain
Keychain. It is a living document that will grow and evolve as we add more features and functionality to
Expand Down
8 changes: 3 additions & 5 deletions app/app/keychain/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default function SettingPage(): JSX.Element {
props: {
to: '/keychain/settings/about/design',
icon: 'codesquareo',
title: 'Design',
title: 'Design System',
},
},
{
Expand Down Expand Up @@ -211,14 +211,11 @@ function SettingRowLink(props: RowProps): JSX.Element {
await haptic.impactAsync();
}}
>
<View style={tailwind('px-6 bg-stone-800 flex-row items-center justify-between')}>
<View style={tailwind('px-6 bg-stone-800 flex-row items-center')}>
<View style={tailwind('py-3 flex-row items-center justify-between')}>
<IconSet name={props.icon} size={20} style={tailwind('text-white')}></IconSet>
<Text style={tailwind('text-white text-base ml-2')}>{props.title}</Text>
</View>
<View>
<IconSet name="right" size={16} style={tailwind('text-stone-500')} />
</View>
</View>
</TouchableOpacity>
);
Expand All @@ -235,6 +232,7 @@ function SettingRowSelect(props: RowProps): JSX.Element {
router.push(props.to!);
await haptic.selectionAsync();
}}
testID={props.to}
>
<View style={tailwind('px-6 bg-stone-800 flex-row items-center justify-between')}>
<View style={tailwind('py-3 flex-row items-center justify-between')}>
Expand Down
12 changes: 2 additions & 10 deletions app/playwright.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig, devices } from '@playwright/test';
import { defineConfig } from '@playwright/test';

export default defineConfig({
testDir: 'app',
Expand Down Expand Up @@ -41,15 +41,7 @@ export default defineConfig({
baseURL: 'http://localhost:8081',
// Collect trace when retrying the failed test.
trace: 'on',
// equivalent to cypress: macbook-16
viewport: { width: 1200, height: 1200 },
viewport: { width: 500, height: 900 },
video: 'on',
},

projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
});

0 comments on commit 60a097a

Please sign in to comment.