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