-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Expand file tree
/
Copy pathload-simple-icons.spec.js
More file actions
35 lines (31 loc) · 1.28 KB
/
load-simple-icons.spec.js
File metadata and controls
35 lines (31 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { expect } from 'chai'
import loadSimpleIcons from './load-simple-icons.js'
describe('loadSimpleIcons', function () {
let simpleIcons
before(function () {
simpleIcons = loadSimpleIcons()
})
it('prepares three color themes', function () {
expect(simpleIcons.get('sentry').styles).to.have.all.keys(
'default',
'light',
'dark',
)
})
it('normalizes icon keys', function () {
// As of v5 of simple-icons the slug and exported key is `linuxfoundation`
// with a name of `Linux Foundation`, so ensure we support both as well
// as the legacy mapping of `linux-foundation` for backwards compatibility.
expect(simpleIcons.has('linuxfoundation')).to.be.true
expect(simpleIcons.has('linux foundation')).to.be.true
expect(simpleIcons.has('linux-foundation')).to.be.true
})
it('maps overlapping icon titles correctly', function () {
// Both of these icons have the same title: 'Hive', so make sure
// the proper slugs are still mapped to the correct logo
expect(simpleIcons.get('hive').slug).to.equal('hive')
expect(simpleIcons.get('hive').title).to.equal('Hive')
expect(simpleIcons.get('hive_blockchain').slug).to.equal('hive_blockchain')
expect(simpleIcons.get('hive_blockchain').title).to.equal('Hive')
})
})