Sha256: d172e542335cdc72416401019e45136ee1305d47376b826c311b3fc8284d64df

Contents?: true

Size: 971 Bytes

Versions: 24

Compression:

Stored size: 971 Bytes

Contents

import buildService from '../page'
import MockedServices from '@/spec/__mocks__/services'
import { page } from '@/spec/__mocks__/page'

describe('PageService', () => {
  let service = null

  beforeEach(() => {
    service = buildService(MockedServices.api)
  })

  describe('#normalize', () => {
    it('takes a Page object and normalize it into entities', () => {
      const output = service.normalize(page)
      expect(output.result).toEqual(1)
      expect(Object.keys(output.entities.sections)).toStrictEqual([
        'GrYZW-VP',
        '8hKSujtd',
        'xM6f-kyh',
      ])
      expect(Object.keys(output.entities.blocks)).toStrictEqual([
        'RiEo8C3f',
        'P1fGieWs',
        'sDo-Dg85',
        'K-C_zRcH',
        'fNIEuzF0',
        'UVGOFAI5',
        'K3Xotn7f',
        'Pst6WyU0',
      ])
      expect(output.entities.page['1'].sections).toStrictEqual([
        'GrYZW-VP',
        '8hKSujtd',
        'xM6f-kyh',
      ])
    })
  })
})

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
maglevcms-1.7.3 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.7.2 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.7.1 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.7.0 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.6.1 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.6.0 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.5.1 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.4.0 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.3.0 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.2.2 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.2.1 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.2.0 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.1.7 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.1.6 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.1.5 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.1.4 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.1.3 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.1.2 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.1.1 app/frontend/editor/services/__tests__/page.spec.js
maglevcms-1.1.0 app/frontend/editor/services/__tests__/page.spec.js