Skip to content

Commit

Permalink
Fix rest ui e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiesholl committed Jan 20, 2025
1 parent b921fa3 commit d652cdb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/packages/admin-ui-components/src/spinner/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ type Props = {

export const Spinner = ({ size = SpinnerSize.LARGE }: Props) => {
return (
<div className={clsx(styles.container, size === SpinnerSize.SMALL && styles.small)}>
<div
data-testid="spinner"
className={clsx(styles.container, size === SpinnerSize.SMALL && styles.small)}
>
<div className={clsx(styles.wrapper, size === SpinnerSize.SMALL && styles.small)}>
<div className={styles.loader}></div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect } from '@playwright/test';
import { expect, test } from '@playwright/test';

import { config } from '../../../config';

Expand Down Expand Up @@ -37,7 +37,7 @@ test('Ensure people can be filtered', async ({ page }) => {
await page.getByTestId('Person-entity-link').click();
await page.getByTestId('url-filter').getByRole('combobox').click();
await page.getByRole('option', { name: '4', exact: true }).click();
await page.getByTestId('loader').waitFor({ state: 'hidden' });
await page.getByTestId('spinner').waitFor({ state: 'hidden' });

// Only Darth Vader should be showing.
await expect(await page.getByTestId('table').locator('tbody').locator('tr').count()).toBe(1);
Expand All @@ -47,7 +47,7 @@ test('Ensure people can be filtered', async ({ page }) => {

await page.getByTestId('url-filter').getByRole('combobox').click();
await page.getByRole('option', { name: '2', exact: true }).click();
await page.getByTestId('loader').waitFor({ state: 'hidden' });
await page.getByTestId('spinner').waitFor({ state: 'hidden' });

// Now Darth Vader and C-3PO should be showing.
await expect(await page.getByTestId('table').locator('tbody').locator('tr').count()).toBe(2);
Expand All @@ -60,7 +60,7 @@ test('Ensure people can be filtered', async ({ page }) => {

// Clear the filters, and we should be back to everyone.
await page.getByRole('button', { name: 'Clear Filters' }).click();
await page.getByTestId('loader').waitFor({ state: 'hidden' });
await page.getByTestId('spinner').waitFor({ state: 'hidden' });
await expect(await page.getByTestId('table').locator('tbody').locator('tr').count()).toBe(50);
});

Expand All @@ -70,7 +70,7 @@ test('Ensure vehicles can be filtered', async ({ page }) => {
await page.getByTestId('Vehicle-entity-link').click();
await page.getByTestId('url-filter').getByRole('combobox').click();
await page.getByRole('option', { name: '4', exact: true }).click();
await page.getByTestId('loader').waitFor({ state: 'hidden' });
await page.getByTestId('spinner').waitFor({ state: 'hidden' });

// Only the Sand Crawler should be showing.
await expect(await page.getByTestId('table').locator('tbody').locator('tr').count()).toBe(1);
Expand All @@ -80,7 +80,7 @@ test('Ensure vehicles can be filtered', async ({ page }) => {

await page.getByTestId('url-filter').getByRole('combobox').click();
await page.getByRole('option', { name: '14', exact: true }).click();
await page.getByTestId('loader').waitFor({ state: 'hidden' });
await page.getByTestId('spinner').waitFor({ state: 'hidden' });

// Now Sand Crawler and Snowspeeder should be showing.
await expect(await page.getByTestId('table').locator('tbody').locator('tr').count()).toBe(2);
Expand All @@ -93,6 +93,6 @@ test('Ensure vehicles can be filtered', async ({ page }) => {

// Clear the filters, and we should be back to all vehicles.
await page.getByRole('button', { name: 'Clear Filters' }).click();
await page.getByTestId('loader').waitFor({ state: 'hidden' });
await page.getByTestId('spinner').waitFor({ state: 'hidden' });
await expect(await page.getByTestId('table').locator('tbody').locator('tr').count()).toBe(39);
});

0 comments on commit d652cdb

Please sign in to comment.