mirror of
https://github.com/iconify/iconify.git
synced 2024-12-15 06:47:30 +00:00
46 lines
924 B
TypeScript
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,
|
||
|
});
|
||
|
});
|
||
|
});
|