2021-12-11 23:26:58 +00:00
|
|
|
import { FileSystemIconLoader } from '../lib';
|
|
|
|
|
|
|
|
describe('Testing FileSystemIconLoader', () => {
|
2022-01-09 20:44:48 +00:00
|
|
|
test('FileSystemIconLoader', async () => {
|
|
|
|
const result = await FileSystemIconLoader(__dirname + '/fixtures')(
|
|
|
|
'circle'
|
|
|
|
);
|
2021-12-11 23:26:58 +00:00
|
|
|
expect(result && result.indexOf('svg') > -1).toBeTruthy();
|
|
|
|
});
|
2022-01-09 20:44:48 +00:00
|
|
|
|
|
|
|
test('FileSystemIconLoader with transform', async () => {
|
|
|
|
const result = await FileSystemIconLoader(
|
|
|
|
__dirname + '/fixtures',
|
|
|
|
(icon) => {
|
|
|
|
return icon.replace('<svg ', '<svg width="1em" height="1em" ');
|
|
|
|
}
|
|
|
|
)('circle');
|
2021-12-11 23:26:58 +00:00
|
|
|
expect(result && result.indexOf('width="1em"') > -1).toBeTruthy();
|
|
|
|
expect(result && result.indexOf('height="1em"') > -1).toBeTruthy();
|
|
|
|
});
|
|
|
|
});
|