2
0
mirror of https://github.com/iconify/iconify.git synced 2024-12-23 02:08:56 +00:00
iconify/packages/utils/tests/merge-customisations-test.ts

46 lines
924 B
TypeScript

import { defaultIconCustomisations } from '../lib/customisations/defaults';
import { mergeCustomisations } from '../lib/customisations/merge';
describe('Testing mergeCustomisations', () => {
test('Empty', () => {
expect(mergeCustomisations(defaultIconCustomisations, {})).toEqual(
defaultIconCustomisations
);
});
test('Flip', () => {
expect(
mergeCustomisations(defaultIconCustomisations, {
hFlip: true,
})
).toEqual({
...defaultIconCustomisations,
hFlip: true,
});
});
test('Excessive rotation', () => {
expect(
mergeCustomisations(defaultIconCustomisations, {
rotate: 10,
})
).toEqual({
...defaultIconCustomisations,
rotate: 2,
});
});
test('Dimensions', () => {
expect(
mergeCustomisations(defaultIconCustomisations, {
width: '1em',
height: 20,
})
).toEqual({
...defaultIconCustomisations,
width: '1em',
height: 20,
});
});
});