Skip to content

Commit

Permalink
test(apps/web): Extend e2e tests for applications page
Browse files Browse the repository at this point in the history
  • Loading branch information
nevendyulgerov committed May 13, 2024
1 parent b062c61 commit c7c8f52
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
34 changes: 34 additions & 0 deletions apps/web/e2e/pages/applications.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,37 @@ test('should display empty state when "My apps" tab is active', async ({
page.getByText("Connect your wallet to list your Applications"),
).toBeVisible();
});

test("should open application summary page", async ({ page }) => {
await expect(page.getByTestId("applications-spinner")).not.toBeVisible();
const applicationSummaryLinks = await page.getByTestId(
"applications-summary-link",
);

const firstLink = applicationSummaryLinks.first();
const href = (await firstLink.getAttribute("href")) as string;

await firstLink.click();
await page.waitForURL(href);
});

test("should open application inputs page", async ({ page }) => {
await expect(page.getByTestId("applications-spinner")).not.toBeVisible();
const applicationInputsLinks = await page.getByTestId("applications-link");

const firstLink = applicationInputsLinks.first();
const href = (await firstLink.getAttribute("href")) as string;

await firstLink.click();
await page.waitForURL(href);
});

test("should open add-connection modal", async ({ page }) => {
await expect(page.getByTestId("applications-spinner")).not.toBeVisible();
const addConnectionButton = await page.getByTestId("add-connection");

const firstButton = addConnectionButton.first();

await firstButton.click();
await expect(page.getByText("Create App Connection")).toBeVisible();
});
2 changes: 1 addition & 1 deletion apps/web/src/components/applications/applicationsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const ApplicationsTable: FC<ApplicationsTableProps> = (props) => {
{fetching ? (
<Table.Tr>
<Table.Td align="center" colSpan={3}>
<Loader />
<Loader data-testid="applications-spinner" />
</Table.Td>
</Table.Tr>
) : (
Expand Down

0 comments on commit c7c8f52

Please sign in to comment.