pleroma-fe/test/unit/specs/services/theme_data/iss_deserializer.spec.js

17 lines
680 B
JavaScript
Raw Normal View History

2024-09-19 17:37:14 +00:00
import { deserialize } from 'src/services/theme_data/iss_deserializer.js'
2024-09-19 23:05:25 +00:00
import { serialize } from 'src/services/theme_data/iss_serializer.js'
import Button from 'src/components/button.style.js'
2024-09-19 17:37:14 +00:00
2024-09-19 23:05:25 +00:00
describe.only('ISS (de)serialization', () => {
describe('ISS deserialization', () => {
2024-09-19 23:07:27 +00:00
it('Output should equal input', () => {
2024-09-19 23:05:25 +00:00
const normalized = Button.defaultRules.map(x => ({ component: 'Button', ...x }))
const serialized = serialize(normalized)
const deserialized = deserialize(serialized)
2024-09-19 17:37:14 +00:00
2024-09-19 23:07:27 +00:00
// for some reason comparing objects directly fails the assert
2024-09-19 23:05:25 +00:00
expect(JSON.stringify(deserialized)).to.equal(JSON.stringify(normalized))
2024-09-19 17:37:14 +00:00
})
})
})