Skip to content

Commit 2b6348b

Browse files
author
naman-contentstack
committed
update test cases
1 parent d335ad5 commit 2b6348b

File tree

11 files changed

+188
-255
lines changed

11 files changed

+188
-255
lines changed

.talismanrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fileignoreconfig:
7272
- filename: packages/contentstack-export/test/unit/export/modules/assets.test.ts
7373
checksum: 12d899d85de5852337a8df36830bb43829be335fb982629134027ede679357a5
7474
- filename: packages/contentstack-export/test/unit/export/modules/marketplace-apps.test.ts
75-
checksum: 886823929388a5b5e8f7e7e747380c81a6582957fe495563fbc313d9992182bc
75+
checksum: 2dfcd63eaf8c1692f37ace4f6d300834d752998e56fed13f8aac750c572197ff
7676
- filename: packages/contentstack-export/test/unit/export/modules/locales.test.ts
7777
checksum: cc1f1cebbfffb1c03f5f98268aec55656e60f5251154592e6234b7ce08b6918e
7878
- filename: packages/contentstack-export/test/unit/export/modules/entries.test.ts
@@ -109,4 +109,10 @@ fileignoreconfig:
109109
checksum: d777e56768b53ecd9e5b0a27f4a59950e0791a5487dbcf4d2666510195e20767
110110
- filename: packages/contentstack-import/test/unit/utils/import-config-handler.test.ts
111111
checksum: 5c0add2367ef71367709a6668f4814f80fedda4cafba1f2149f8ceb136128c18
112+
- filename: packages/contentstack-export/test/unit/utils/marketplace-app-helper.test.ts
113+
checksum: 7378a63f935c67af0b4fe40175d24f5f1c91e2b3dbaeda503e2d060700eadb20
114+
- filename: packages/contentstack-import/test/unit/utils/marketplace-app-helper.test.ts
115+
checksum: 24c05dc08fe6fd2c0f19754a6dea61505f2cb124c7697750f9c27f11084fd4f0
116+
- filename: packages/contentstack-import/test/unit/utils/common-helper.test.ts
117+
checksum: 533043fcc944d91d1bfa084a6ba6e87409986c2931197d145237862f55143374
112118
version: '1.0'

packages/contentstack-export/test/unit/export/modules/entries.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,18 @@ describe('EntriesExport', () => {
163163

164164
it('should set up correct directory paths based on exportConfig', () => {
165165
const expectedEntriesPath = path.resolve(
166-
mockExportConfig.data,
166+
mockExportConfig.exportDir,
167167
mockExportConfig.branchName || '',
168168
mockExportConfig.modules.entries.dirName,
169169
);
170170
const expectedLocalesPath = path.resolve(
171-
mockExportConfig.data,
171+
mockExportConfig.exportDir,
172172
mockExportConfig.branchName || '',
173173
mockExportConfig.modules.locales.dirName,
174174
mockExportConfig.modules.locales.fileName,
175175
);
176176
const expectedSchemaPath = path.resolve(
177-
mockExportConfig.data,
177+
mockExportConfig.exportDir,
178178
mockExportConfig.branchName || '',
179179
mockExportConfig.modules.content_types.dirName,
180180
'schema.json',

packages/contentstack-export/test/unit/export/modules/marketplace-apps.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ describe('ExportMarketplaceApps', () => {
1818
versioning: false,
1919
host: 'https://api.contentstack.io',
2020
developerHubUrls: {},
21-
apiKey: 'test-api-key',
21+
apiKey: 'test-stack-uid',
2222
exportDir: '/test/export',
2323
data: '/test/data',
2424
branchName: '',
25-
source_stack: 'test-stack-uid',
2625
org_uid: 'test-org-uid',
2726
context: {
2827
command: 'cm:stacks:export',
@@ -214,7 +213,7 @@ describe('ExportMarketplaceApps', () => {
214213
await exportMarketplaceApps.start();
215214

216215
expect(exportMarketplaceApps.marketplaceAppPath).to.include('marketplace-apps');
217-
expect(exportMarketplaceApps.marketplaceAppPath).to.include('/test/data');
216+
expect(exportMarketplaceApps.marketplaceAppPath).to.include('/test/export');
218217

219218
exportAppsStub.restore();
220219
configHandlerGetStub.restore();

packages/contentstack-export/test/unit/utils/export-config-handler.test.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -131,25 +131,6 @@ describe('Export Config Handler', () => {
131131
expect((config as any).customField).to.equal('customValue');
132132
});
133133

134-
it('should reject deprecated contentVersion property', async () => {
135-
configHandlerGetStub.withArgs('authorisationType').returns('OAUTH');
136-
137-
const externalConfig = {
138-
contentVersion: 2,
139-
customField: 'customValue',
140-
};
141-
readFileStub.resolves(externalConfig);
142-
143-
const flags = { config: '/path/to/config.json', data: '/test/data' };
144-
145-
try {
146-
await setupConfig(flags);
147-
expect.fail('Should have thrown an error for deprecated contentVersion');
148-
} catch (error: any) {
149-
expect(error.message).to.include('Unsupported configuration properties detected: contentVersion');
150-
expect(error.message).to.include('no longer supported in the beta version');
151-
}
152-
});
153134
});
154135

155136
describe('Management Token Alias', () => {

packages/contentstack-export/test/unit/utils/marketplace-app-helper.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ describe('Marketplace App Helper Utils', () => {
1515
versioning: false,
1616
host: 'https://api.contentstack.io',
1717
developerHubUrls: {},
18-
apiKey: 'test-api-key',
18+
apiKey: 'test-stack-uid',
1919
exportDir: '/test/export',
2020
data: '/test/data',
2121
branchName: '',
22-
source_stack: 'test-stack-uid',
2322
context: {
2423
command: 'cm:stacks:export',
2524
module: 'marketplace-apps',
@@ -122,8 +121,8 @@ describe('Marketplace App Helper Utils', () => {
122121
expect(result).to.equal('test-org-uid-123');
123122
});
124123

125-
it('should use source_stack from config as api_key', async () => {
126-
mockExportConfig.source_stack = 'custom-stack-key';
124+
it('should use apiKey from config as api_key', async () => {
125+
mockExportConfig.apiKey = 'custom-stack-key';
127126
const mockStackData = { org_uid: 'org-123' };
128127

129128
const mockFetch = sandbox.stub().resolves(mockStackData);

0 commit comments

Comments
 (0)