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.7.2 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.7.1 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.7.0 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.6.1 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.6.0 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.5.1 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.4.0 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.3.0 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.2.2 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.2.1 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.2.0 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.1.7 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.1.6 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.1.5 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.1.4 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.1.3 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.1.2 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.1.1 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.1.0 app/frontend/editor/services/__tests__/section.spec.js
maglevcms-1.0.0 app/javascript/editor/services/__tests__/section.spec.js