Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
braginini committed Dec 29, 2023
1 parent 2d13d10 commit ea05b49
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions e2e-tests/pages/modals/add-peer-modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export class AddPeerModal {
private readonly windowsTab = this.page.getByTestId('add-peer-modal-windows-tab')
private readonly macTab = this.page.getByTestId('add-peer-modal-mac-tab')
private readonly androidTab = this.page.getByTestId('add-peer-modal-android-tab')
private readonly iosTab = this.page.getByTestId('add-peer-modal-ios-tab')
private readonly dockerTab = this.page.getByTestId('add-peer-modal-docker-tab')
private readonly linuxTabText = this.page.locator('pre').filter({ hasText: 'curl -fsSL https://pkgs.netbird.io/install.sh | sh' })
private readonly windowsDownloadButton = this.page.getByTestId('download-windows-button')
Expand Down Expand Up @@ -57,6 +58,13 @@ export class AddPeerModal {
})
}

async openIOSTab() {
await test.step('Open iOS tab on add peer modal', async () => {
await this.iosTab.click();

})
}

async openDockerTab() {
await test.step('Open Docker tab on add peer modal', async () => {
await this.dockerTab.click();
Expand Down
5 changes: 5 additions & 0 deletions e2e-tests/tests/peers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ test('Test MacOS tab on a first access add peer modal / @bc', async () => {
await addPeerModal.assertM1M2DownloadButtonHasCorrectLink();
});

test('Test iOS tab on a first access add peer modal', async () => {
await addPeerModal.openIOSTab();
await addPeerModal.assertAndroidDownloadButtonHasCorrectLink();
});

test('Test Android tab on a first access add peer modal', async () => {
await addPeerModal.openAndroidTab();
await addPeerModal.assertAndroidDownloadButtonHasCorrectLink();
Expand Down
2 changes: 1 addition & 1 deletion src/components/popups/addpeer/addpeer/AddPeerPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const AddPeerPopup: React.FC<Props> = ({
},
{
key: "4",
label: <span data-testid="add-peer-modal-android-tab"><IOSIcon/>iOS</span>,
label: <span data-testid="add-peer-modal-ios-tab"><IOSIcon/>iOS</span>,
children: <IOSTab/>,
},
{
Expand Down

0 comments on commit ea05b49

Please sign in to comment.