2
0
mirror of https://github.com/iconify/iconify.git synced 2025-01-22 22:58:27 +00:00

Add provider to SVG class names list, update unit tests

This commit is contained in:
Vjacheslav Trushkin 2020-06-02 00:31:57 +03:00
parent eb758c4fde
commit cf3d9394ee
3 changed files with 5 additions and 4 deletions

View File

@ -2,14 +2,14 @@ import mocha from 'mocha';
import chai from 'chai'; import chai from 'chai';
import { FakeData, setFakeData, prepareQuery, sendQuery } from './fake-api'; import { FakeData, setFakeData, prepareQuery, sendQuery } from './fake-api';
import { API } from '@iconify/core/lib/api/'; import { API } from '@iconify/core/lib/api/';
import { setDefaultAPIModule } from '@iconify/core/lib/api/modules'; import { setAPIModule } from '@iconify/core/lib/api/modules';
import { setAPIConfig } from '@iconify/core/lib/api/config'; import { setAPIConfig } from '@iconify/core/lib/api/config';
import { coreModules } from '@iconify/core/lib/modules'; import { coreModules } from '@iconify/core/lib/modules';
const expect = chai.expect; const expect = chai.expect;
// Set API // Set API
setDefaultAPIModule({ setAPIModule('', {
prepare: prepareQuery, prepare: prepareQuery,
send: sendQuery, send: sendQuery,
}); });

View File

@ -5,7 +5,7 @@ import { getNode } from './node';
import { addFinder } from '@iconify/iconify/lib/finder'; import { addFinder } from '@iconify/iconify/lib/finder';
import { FakeData, setFakeData, prepareQuery, sendQuery } from './fake-api'; import { FakeData, setFakeData, prepareQuery, sendQuery } from './fake-api';
import { API } from '@iconify/core/lib/api/'; import { API } from '@iconify/core/lib/api/';
import { setDefaultAPIModule } from '@iconify/core/lib/api/modules'; import { setAPIModule } from '@iconify/core/lib/api/modules';
import { setAPIConfig } from '@iconify/core/lib/api/config'; import { setAPIConfig } from '@iconify/core/lib/api/config';
import { coreModules } from '@iconify/core/lib/modules'; import { coreModules } from '@iconify/core/lib/modules';
import { finder as iconifyFinder } from '@iconify/iconify/lib/finders/iconify'; import { finder as iconifyFinder } from '@iconify/iconify/lib/finders/iconify';
@ -20,7 +20,7 @@ addFinder(iconifyFinder);
addFinder(iconifyIconFinder); addFinder(iconifyIconFinder);
// Set API // Set API
setDefaultAPIModule({ setAPIModule('', {
prepare: prepareQuery, prepare: prepareQuery,
send: sendQuery, send: sendQuery,
}); });

View File

@ -41,6 +41,7 @@ export function renderIcon(
const className = const className =
'iconify iconify--' + 'iconify iconify--' +
name.prefix + name.prefix +
(name.provider === '' ? '' : ' iconify--' + name.provider) +
(filteredClassList.length ? ' ' + filteredClassList.join(' ') : ''); (filteredClassList.length ? ' ' + filteredClassList.join(' ') : '');
// Generate SVG as string // Generate SVG as string