mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add unit tests for utils (#5412)
* add unit tests for Card utils * add unit tests for DateFnsLocale utils * fix lint * add unit tests for Events utils * fix lint * fix lint
This commit is contained in:
parent
f57c089ae2
commit
a133a33a00
3 changed files with 184 additions and 0 deletions
37
src/utils/card.test.ts
Normal file
37
src/utils/card.test.ts
Normal file
|
@ -0,0 +1,37 @@
|
|||
import { describe, expect, it } from 'vitest';
|
||||
import * as card from './card';
|
||||
|
||||
describe('Utils: card', () => {
|
||||
describe('Function: getSquareShape', () => {
|
||||
it('Should return "overflowSquare"', () => {
|
||||
const result = card.getSquareShape(true);
|
||||
expect(result).toEqual('overflowSquare');
|
||||
});
|
||||
it('Should return "square"', () => {
|
||||
const result = card.getSquareShape(false);
|
||||
expect(result).toEqual('square');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Function: getBackdropShape', () => {
|
||||
it('Should return "overflowBackdrop"', () => {
|
||||
const result = card.getBackdropShape(true);
|
||||
expect(result).toEqual('overflowBackdrop');
|
||||
});
|
||||
it('Should return "backdrop"', () => {
|
||||
const result = card.getBackdropShape(false);
|
||||
expect(result).toEqual('backdrop');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Function: getPortraitShape', () => {
|
||||
it('Should return "overflowPortrait"', () => {
|
||||
const result = card.getPortraitShape(true);
|
||||
expect(result).toEqual('overflowPortrait');
|
||||
});
|
||||
it('Should return "portrait"', () => {
|
||||
const result = card.getPortraitShape(false);
|
||||
expect(result).toEqual('portrait');
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue