Sha256: 075f31a687f3322f1b723c270a3deff514ade8a4979e84aad251bfba92297f6b

Contents?: true

Size: 1.03 KB

Versions: 23

Compression:

Stored size: 1.03 KB

Contents

import * as service from '../section'
import {
  simpleContentSection,
  navContentSection,
} from '@/spec/__mocks__/section'

describe('SectionService', () => {
  describe('#normalize', () => {
    it('takes a Section object and normalize it into entities', () => {
      const output = service.normalize(simpleContentSection)
      // console.log(JSON.stringify(output))
      expect(output.result).toEqual('NEW-CONTENT-1')
      expect(Object.keys(output.entities.sections)).toStrictEqual([
        'NEW-CONTENT-1',
      ])
    })
    it('takes a Section object with blocks and normalize it into entities', () => {
      const output = service.normalize(navContentSection)
      // console.log(JSON.stringify(output))
      expect(output.result).toEqual('NEW-NAV-CONTENT-1')
      expect(Object.keys(output.entities.sections)).toStrictEqual([
        'NEW-NAV-CONTENT-1',
      ])
      expect(Object.keys(output.entities.blocks)).toStrictEqual([
        'RiEo8C3f',
        'P1fGieWs',
        'sDo-Dg85',
        'K-C_zRcH',
      ])
    })
  })
})

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
maglevcms-1.0.0.rc3 app/javascript/editor/services/__tests__/section.spec.js
maglevcms-1.0.0.rc2 app/javascript/editor/services/__tests__/section.spec.js
maglevcms-1.0.0.rc1 app/javascript/editor/services/__tests__/section.spec.js