blob: 7654fb53bf796a7ffa3d7425232e523eb67e887d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import { deserialize } from 'src/services/theme_data/iss_deserializer.js'
import { serialize } from 'src/services/theme_data/iss_serializer.js'
import Button from 'src/components/button.style.js'
describe('ISS (de)serialization', () => {
describe('ISS deserialization', () => {
it('Output should equal input', () => {
const normalized = Button.defaultRules.map(x => ({ component: 'Button', ...x }))
const serialized = serialize(normalized)
const deserialized = deserialize(serialized)
// for some reason comparing objects directly fails the assert
expect(JSON.stringify(deserialized)).to.equal(JSON.stringify(normalized))
})
})
})
|