2021-05-26 10:01:23 +03:00
|
|
|
import { getIconData } from '../lib/icon-set/get-icon';
|
2021-05-24 13:25:02 +03:00
|
|
|
|
|
|
|
describe('Testing getting icon data', () => {
|
2021-09-20 23:53:49 +03:00
|
|
|
test('Simple icon', () => {
|
2022-07-01 23:09:53 +03:00
|
|
|
const result = getIconData(
|
2021-05-24 13:25:02 +03:00
|
|
|
{
|
|
|
|
prefix: 'foo',
|
|
|
|
icons: {
|
|
|
|
bar: {
|
|
|
|
body: '<g />',
|
|
|
|
width: 24,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2022-07-01 23:09:53 +03:00
|
|
|
'bar'
|
2021-05-24 13:25:02 +03:00
|
|
|
);
|
2022-07-01 23:09:53 +03:00
|
|
|
expect(result).toEqual({
|
2021-05-24 13:25:02 +03:00
|
|
|
body: '<g />',
|
|
|
|
width: 24,
|
|
|
|
});
|
|
|
|
});
|
2021-05-27 19:52:31 +03:00
|
|
|
|
2021-09-20 23:53:49 +03:00
|
|
|
test('Minified icon set', () => {
|
2022-07-01 23:09:53 +03:00
|
|
|
const result = getIconData(
|
2021-05-27 19:52:31 +03:00
|
|
|
{
|
|
|
|
prefix: 'foo',
|
|
|
|
icons: {
|
|
|
|
bar: {
|
|
|
|
body: '<g />',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
width: 24,
|
|
|
|
height: 24,
|
|
|
|
},
|
2022-07-01 23:09:53 +03:00
|
|
|
'bar'
|
2021-05-27 19:52:31 +03:00
|
|
|
);
|
2022-07-01 23:09:53 +03:00
|
|
|
expect(result).toEqual({
|
2021-05-27 19:52:31 +03:00
|
|
|
body: '<g />',
|
|
|
|
width: 24,
|
|
|
|
height: 24,
|
|
|
|
});
|
|
|
|
});
|
2021-05-24 13:25:02 +03:00
|
|
|
});
|