chore(web): use development lang for tests (#10025)

This commit is contained in:
Michel Heusschen 2024-06-07 17:12:39 +02:00 committed by GitHub
parent 3e118793de
commit d5f3d98dfc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 7 additions and 24 deletions

View file

@ -1,16 +1,11 @@
import '@testing-library/jest-dom';
import { cleanup, render, type RenderResult } from '@testing-library/svelte';
import { init } from 'svelte-i18n';
import { NotificationType } from '../notification';
import NotificationCard from '../notification-card.svelte';
describe('NotificationCard component', () => {
let sut: RenderResult<NotificationCard>;
beforeAll(async () => {
await init({ fallbackLocale: 'en-US' });
});
it('disposes timeout if already removed from the DOM', () => {
vi.spyOn(window, 'clearTimeout');

View file

@ -1,6 +1,5 @@
import '@testing-library/jest-dom';
import { render, waitFor, type RenderResult } from '@testing-library/svelte';
import { init } from 'svelte-i18n';
import { get } from 'svelte/store';
import { NotificationType, notificationController } from '../notification';
import NotificationList from '../notification-list.svelte';
@ -12,8 +11,7 @@ function _getNotificationListElement(sut: RenderResult<NotificationList>): HTMLA
describe('NotificationList component', () => {
const sut: RenderResult<NotificationList> = render(NotificationList);
beforeAll(async () => {
await init({ fallbackLocale: 'en-US' });
beforeAll(() => {
// https://testing-library.com/docs/svelte-testing-library/faq#why-arent-transition-events-running
vi.stubGlobal('requestAnimationFrame', (fn: FrameRequestCallback) => {
setTimeout(() => fn(Date.now()), 16);