Skip to content

Commit 4caf9b1

Browse files
committed
fix test that failed since forms-api Form is different than NavFormType
1 parent 5c4c6d7 commit 4caf9b1

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/bygger-backend/src/migration/FormMigrationLogger.test.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ describe('FormMigrationLogger', () => {
2323

2424
describe('getLog', () => {
2525
it('contains title, path and key properties from the form', () => {
26-
const { name, path, title, properties } = formWithSimpleConditionalToRadio;
27-
expect(logger.getLog()).toEqual(expect.objectContaining({ name, path, title, ...properties }));
26+
const { name, path, title, publishedAt, publishedBy, status, properties } = formWithSimpleConditionalToRadio;
27+
const { isTestForm, skjemanummer } = properties;
28+
expect(logger.getLog()).toEqual(
29+
expect.objectContaining({ name, path, title, publishedAt, publishedBy, status, isTestForm, skjemanummer }),
30+
);
2831
});
2932

3033
describe('When all entries contains identical original and new components', () => {

packages/bygger-backend/src/migration/testData.ts

+6
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ const formWithSimpleConditionalToRadio = {
144144
name: 'formWithSimpleConditionalToRadio',
145145
path: 'formWithSimpleConditionalToRadio',
146146
title: 'Form with simple conditional to radio',
147+
changedAt: '2022-11-17T13:12:38.825Z',
148+
changedBy: '[email protected]',
149+
publishedAt: '2022-11-17T13:12:38.825Z',
150+
publishedBy: '[email protected]',
151+
publishedLanguages: ['en'],
152+
status: 'published',
147153
properties: {
148154
skjemanummer: 'formWithSimpleConditionalToRadio',
149155
...generalProperties,

0 commit comments

Comments
 (0)