Skip to content

Commit 0c04afa

Browse files
authored
Merge branch 'development' into fix/DX-3623
2 parents 47f19ac + faa3c28 commit 0c04afa

File tree

8 files changed

+2995
-1
lines changed

8 files changed

+2995
-1
lines changed

.talismanrc

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,5 +178,27 @@ fileignoreconfig:
178178
- filename: packages/contentstack-import/test/unit/utils/file-helper.test.ts
179179
checksum: a5cd371d7f327c083027da4157b3c5b4df548f2c2c3ad6193aa133031994252e
180180
- filename: packages/contentstack-import/test/unit/utils/common-helper.test.ts
181-
checksum: fa2d4819d3e3f682bc83e3a6442fdff45e206b4a90a80f98fa0fb35feb99d1c4
181+
checksum: 61b3cfe0c0571dcc366e372990e3c11ced2b49703ac88155110d33897e58ca5d
182+
- filename: packages/contentstack-import/test/unit/import/module-importer.test.ts
183+
checksum: aa265917b806286c8d4d1d3f422cf5d6736a0cf6a5f50f2e9c04ec0f81eee376
184+
- filename: packages/contentstack-export/test/unit/utils/interactive.test.ts
185+
checksum: b619744ebba28dbafe3a0e65781a61a6823ccaa3eb84e2b380a323c105324c1a
186+
- filename: packages/contentstack-import/test/unit/import/modules/index.test.ts
187+
checksum: aab773ccbe05b990a4b934396ee2fcd2a780e7d886d080740cfddd8a4d4f73f7
188+
- filename: packages/contentstack-import/test/unit/import/modules/personalize.test.ts
189+
checksum: ea4140a1516630fbfcdd61c4fe216414b733b4df2410b5d090d58ab1a22e7dbf
190+
- filename: packages/contentstack-import/test/unit/import/modules/variant-entries.test.ts
191+
checksum: abcc2ce0b305afb655eb46a1652b3d9e807a2a2e0eef1caeb16c8ae83af4f1a1
192+
- filename: packages/contentstack-import/test/unit/utils/import-path-resolver.test.ts
193+
checksum: 05436c24619b2d79b51eda9ce9a338182cc69b078ede60d310bfd55a62db8369
194+
- filename: packages/contentstack-import/test/unit/utils/interactive.test.ts
195+
checksum: 77a45bd7326062053b98d1333fa59147757a5a8abdb34057a347ca2a1b95b343
196+
- filename: packages/contentstack-import/test/unit/utils/import-config-handler.test.ts
197+
checksum: 20bbfb405a183b577f8ae8f2b47013bc42729aa817d617264e0c3a70b3fa752b
198+
- filename: packages/contentstack-import/test/unit/utils/login-handler.test.ts
199+
checksum: bea00781cdffc2d085b3c85d6bde75f12faa3ee51930c92e59777750a6727325
200+
- filename: packages/contentstack-import/test/unit/utils/marketplace-app-helper.test.ts
201+
checksum: eca2702d1f7ed075b9b857964b9e56f69b16e4a31942423d6b1265e4bf398db5
202+
- filename: packages/contentstack-import/test/unit/utils/logger.test.ts
203+
checksum: 794e06e657a7337c8f094d6042fb04c779683f97b860efae14e075098d2af024
182204
version: "1.0"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { expect } from 'chai';
2+
import { gfSchemaTemplate } from '../../../src/utils/global-field-helper';
3+
4+
describe('Global Field Helper', () => {
5+
describe('gfSchemaTemplate', () => {
6+
it('should export a schema template object', () => {
7+
expect(gfSchemaTemplate).to.be.an('object');
8+
expect(gfSchemaTemplate).to.have.property('global_field');
9+
});
10+
11+
it('should have correct structure for global_field', () => {
12+
const globalField = gfSchemaTemplate.global_field;
13+
14+
expect(globalField).to.be.an('object');
15+
expect(globalField).to.have.property('title', 'Seed');
16+
expect(globalField).to.have.property('uid', '');
17+
expect(globalField).to.have.property('schema');
18+
expect(globalField).to.have.property('description', '');
19+
});
20+
21+
it('should have schema as an array', () => {
22+
const schema = gfSchemaTemplate.global_field.schema;
23+
24+
expect(schema).to.be.an('array');
25+
expect(schema).to.have.lengthOf(1);
26+
});
27+
28+
it('should have correct structure for first schema field', () => {
29+
const firstField = gfSchemaTemplate.global_field.schema[0];
30+
31+
expect(firstField).to.be.an('object');
32+
expect(firstField).to.have.property('display_name', 'Title');
33+
expect(firstField).to.have.property('uid', 'title');
34+
expect(firstField).to.have.property('data_type', 'text');
35+
expect(firstField).to.have.property('field_metadata');
36+
expect(firstField).to.have.property('unique', false);
37+
expect(firstField).to.have.property('mandatory', true);
38+
expect(firstField).to.have.property('multiple', false);
39+
});
40+
41+
it('should have correct field_metadata structure', () => {
42+
const fieldMetadata = gfSchemaTemplate.global_field.schema[0].field_metadata;
43+
44+
expect(fieldMetadata).to.be.an('object');
45+
expect(fieldMetadata).to.have.property('_default', true);
46+
});
47+
});
48+
});

0 commit comments

Comments
 (0)