This commit is contained in:
Henry Jameson 2024-09-20 02:07:27 +03:00
parent 71a4781080
commit d8d766932a
2 changed files with 2 additions and 3 deletions

View file

@ -125,7 +125,6 @@ export const deserialize = (input) => {
output.directives = Object.fromEntries(content.map(d => { output.directives = Object.fromEntries(content.map(d => {
const [property, value] = d.split(':') const [property, value] = d.split(':')
console.log(property, value)
let realValue = value.trim() let realValue = value.trim()
if (property === 'shadow') { if (property === 'shadow') {
realValue = parseShadow(value.split(',').map(v => v.trim())) realValue = parseShadow(value.split(',').map(v => v.trim()))

View file

@ -4,12 +4,12 @@ import Button from 'src/components/button.style.js'
describe.only('ISS (de)serialization', () => { describe.only('ISS (de)serialization', () => {
describe('ISS deserialization', () => { describe('ISS deserialization', () => {
it('Output should = input', () => { it('Output should equal input', () => {
const normalized = Button.defaultRules.map(x => ({ component: 'Button', ...x })) const normalized = Button.defaultRules.map(x => ({ component: 'Button', ...x }))
const serialized = serialize(normalized) const serialized = serialize(normalized)
const deserialized = deserialize(serialized) const deserialized = deserialize(serialized)
// deserialized.toString()
// for some reason comparing objects directly fails the assert
expect(JSON.stringify(deserialized)).to.equal(JSON.stringify(normalized)) expect(JSON.stringify(deserialized)).to.equal(JSON.stringify(normalized))
}) })
}) })