From f167a29d93b04243688856662b8b6bda15d59b83 Mon Sep 17 00:00:00 2001 From: Mikhail Shkaralevich <76892413+mikhail-shkaralevich@users.noreply.github.com> Date: Thu, 18 Apr 2024 18:49:40 -1000 Subject: [PATCH] Update ci.yml (#15) --- .github/workflows/ci.yml | 3 ++- ui/tests/app/(index)/_components/AfterLogin.test.tsx | 6 +++--- ui/tests/setupJest.ts | 12 ------------ 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77738a43..cc548a52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,8 +28,9 @@ jobs: jest: strategy: matrix: + os: [ubuntu-latest, macos-latest, windows-latest] node-version: [ 18.x, 20.x ] - runs-on: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - name: Checkout code diff --git a/ui/tests/app/(index)/_components/AfterLogin.test.tsx b/ui/tests/app/(index)/_components/AfterLogin.test.tsx index 69551a69..52e6edbf 100644 --- a/ui/tests/app/(index)/_components/AfterLogin.test.tsx +++ b/ui/tests/app/(index)/_components/AfterLogin.test.tsx @@ -37,7 +37,7 @@ describe('AfterLogin', () => { const expectAdministration = (isAdmin: boolean) => { if (isAdmin) { - expect(screen.getByRole('img', {name: 'key-solid'})).toHaveAttribute('src', 'uhgroupings/key-solid.svg'); + expect(screen.getByRole('img', {name: 'key-solid'})).toHaveAttribute('src', '/uhgroupings/key-solid.svg'); expect(screen.queryByText('0')).not.toBeInTheDocument(); expect(screen.getByRole('heading', {name: 'Admin'})).toBeInTheDocument(); expect(screen.getByText('Manage the list of Administrators for this service. ' + @@ -56,7 +56,7 @@ describe('AfterLogin', () => { }; const expectMemberships = () => { - expect(screen.getByRole('img', {name: 'id-card'})).toHaveAttribute('src', 'uhgroupings/id-card-solid.svg'); + expect(screen.getByRole('img', {name: 'id-card'})).toHaveAttribute('src', '/uhgroupings/id-card-solid.svg'); expect(screen.getByText(numberOfMemberships)).toBeInTheDocument(); expect(screen.getByRole('heading', {name: 'Memberships'})).toBeInTheDocument(); expect(screen.getByText('View and manage my memberships. ' + @@ -68,7 +68,7 @@ describe('AfterLogin', () => { const expectGroupings = (isOwner: boolean) => { if (isOwner) { expect(screen.getByRole('img', {name: 'wrench-solid'})) - .toHaveAttribute('src', 'uhgroupings/wrench-solid.svg'); + .toHaveAttribute('src', '/uhgroupings/wrench-solid.svg'); expect(screen.getByText(numberOfGroupings)).toBeInTheDocument(); expect(screen.getByRole('heading', {name: 'Groupings'})).toBeInTheDocument(); expect(screen.getByText('Review members, manage Include and Exclude lists, ' + diff --git a/ui/tests/setupJest.ts b/ui/tests/setupJest.ts index d9244e8c..186f3753 100644 --- a/ui/tests/setupJest.ts +++ b/ui/tests/setupJest.ts @@ -6,18 +6,6 @@ import User from '@/access/User'; enableFetchMocks(); loadEnvConfig(process.cwd()); -Object.defineProperty(window, 'matchMedia', { - writable: true, - value: jest.fn().mockImplementation(query => ({ - matches: false, - media: query, - onchange: null, - addEventListener: jest.fn(), - removeEventListener: jest.fn(), - dispatchEvent: jest.fn(), - })), -}); - export const createMockSession = (user: User | undefined) => ({ user, destroy: jest.fn(),