Migrate tests to Vitest
This commit is contained in:
1 parent
cbe4d79b3c
commit
c0ea3aefbe
15 files changed
+1393
-1839
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { expect, test } from 'vitest';
|
||||
import {
|
||||
BOARD_COMPONENT_COMPATIBILITY_MATRIX,
|
||||
getSupportedBoardComponentEntityTypes,
|
||||
} from './boardComponentCompatibility';
|
||||
import { BOARD_ENTITY_TYPES, isBoardComponentSupported } from './boards';
|
||||
|
||||
test('isBoardComponentSupported allows events chart on website boards', () => {
|
||||
expect(isBoardComponentSupported('EventsChart', BOARD_ENTITY_TYPES.website)).toBe(true);
|
||||
});
|
||||
|
||||
test('isBoardComponentSupported rejects events chart on pixel and link boards', () => {
|
||||
expect(isBoardComponentSupported('EventsChart', BOARD_ENTITY_TYPES.pixel)).toBe(false);
|
||||
expect(isBoardComponentSupported('EventsChart', BOARD_ENTITY_TYPES.link)).toBe(false);
|
||||
});
|
||||
|
||||
test('board component compatibility matrix defines website-only components explicitly', () => {
|
||||
expect(BOARD_COMPONENT_COMPATIBILITY_MATRIX.EventsChart).toEqual([BOARD_ENTITY_TYPES.website]);
|
||||
expect(getSupportedBoardComponentEntityTypes('EventsChart')).toEqual([
|
||||
BOARD_ENTITY_TYPES.website,
|
||||
]);
|
||||
});
|
||||
|
||||
test('isBoardComponentSupported leaves other components available for all board entities', () => {
|
||||
expect(isBoardComponentSupported('WebsiteChart', BOARD_ENTITY_TYPES.pixel)).toBe(true);
|
||||
expect(isBoardComponentSupported('TextBlock', BOARD_ENTITY_TYPES.link)).toBe(true);
|
||||
});
|
||||
Reference in new issue
Block a user