Skip to content

Commit

Permalink
chore(website): mock ResizeObserver, neccesary for headlessui v2
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusroemer committed Jun 29, 2024
1 parent 7e632f8 commit 1efe57a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions website/package-lock.json

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

1 change: 1 addition & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"msw": "^2.3.1",
"prettier": "3.3.2",
"prettier-plugin-astro": "^0.14.0",
"resize-observer-polyfill": "^1.5.1",
"sass": "^1.77.6",
"tailwindcss": "^3.4.4",
"typescript": "^5.5.2",
Expand Down
7 changes: 6 additions & 1 deletion website/vitest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import '@testing-library/jest-dom';
import { HttpStatusCode } from 'axios';
import { http } from 'msw';
import { setupServer } from 'msw/node';
import { afterAll, afterEach, beforeAll, beforeEach } from 'vitest';
import ResizeObserver from 'resize-observer-polyfill';
import { afterAll, afterEach, beforeAll, beforeEach, vi } from 'vitest';

import type { GetSequencesResponse, Group, SequenceEntryToEdit, SubmissionIdMapping } from './src/types/backend.ts';
import type { DetailsResponse, InsertionsResponse, LapisError, MutationsResponse } from './src/types/lapis.ts';
Expand Down Expand Up @@ -33,6 +34,10 @@ export const testConfig = {
backendKeycloakClientSecret: 'dummy',
} as RuntimeConfig;

// Stubbing necessary since headlessui v2
// See https://github.com/tailwindlabs/headlessui/issues/3268
vi.stubGlobal('ResizeObserver', ResizeObserver);

export const metadataKey = 'originalMetaDataField';
export const editableEntry = 'originalMetaDataValue';
export const defaultReviewData: SequenceEntryToEdit = {
Expand Down

0 comments on commit 1efe57a

Please sign in to comment.