Skip to content

Commit

Permalink
fix ci tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mjaquiery committed Mar 14, 2024
1 parent 4c33abf commit 53a7b22
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
id-token: write
pages: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src/Components/__mocks__/IntroText.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// SPDX-License-Identifier: BSD-2-Clause
// Copyright (c) 2020-2023, The Chancellor, Masters and Scholars of the University
// of Oxford, and the 'Galv' Developers. All rights reserved.

import dummy from "./DummyComponent"
import {INTRODUCTIONS} from "../../constants";

export default function LoadingChip(params: {k: keyof typeof INTRODUCTIONS}) {
return dummy("IntroText", params)
}
8 changes: 0 additions & 8 deletions src/test/ResourceCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,6 @@ const do_render = async () => {
)

await screen.findByRole('heading', { name: /^Read-only properties$/ });

// console.log(mockedAxios.request.mock.calls)
// screen.debug(undefined, 1000000)
}

/**
Expand Down Expand Up @@ -491,7 +488,6 @@ describe('ResourceCard', () => {
expect(input).toHaveValue("X");
})
it('allows numbers to be changed', async () => {
console.log("allows numbers to be changed")
const user = userEvent.setup();
await user.click(screen.getByRole('button', {name: /^Edit this /i}));
const id_label = screen.getByRole("rowheader", {name: /^key num$/});
Expand Down Expand Up @@ -535,8 +531,6 @@ describe('ResourceCard', () => {
it('allows removing array elements', async () => {
const {user, row} = await get_array();
const old_element_count = within(row).getAllByRole('textbox').length;
console.log("allows removing array elements")
screen.debug(row, 1000000)
const first_remove_button = within(row).getAllByTestId('RemoveIcon').shift()!;
await user.click(first_remove_button);
await wait();
Expand Down Expand Up @@ -601,8 +595,6 @@ describe('ResourceCard', () => {
const input = within(id_label.parentElement! as HTMLElement).getByRole('combobox');
expect(input).toHaveValue(`representation: CELL_FAMILY [${api_data.cell_family.uuid}]`);
await user.click(input)
console.log("allows resources to be changed")
screen.debug(input, 1000000)
await user.clear(input)
await user.keyboard("2") // should match the second cell family
const autocomplete = await screen.findByRole('listbox');
Expand Down
1 change: 1 addition & 0 deletions src/test/ResourceList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import axios from 'axios';
import {QueryClient, QueryClientProvider} from "@tanstack/react-query";
import FetchResourceContextProvider from "../Components/FetchResourceContext";

jest.mock('../Components/IntroText')
jest.mock('../Components/ResourceCard')

// Mock jest and set the type
Expand Down

0 comments on commit 53a7b22

Please sign in to comment.