Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
- name: Run tests for Contentstack Config
working-directory: ./packages/contentstack-config
run: npm run test

- name: Run tests for Contentstack Migrate RTE
working-directory: ./packages/contentstack-migrate-rte
run: npm run test
# - name: Fetch latest references
# run: |
# git fetch --prune
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/contentstack-migrate-rte/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-migrate-rte
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-migrate-rte/1.5.0 darwin-arm64 node-v22.14.0
@contentstack/cli-cm-migrate-rte/1.5.1 darwin-arm64 node-v22.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-migrate-rte/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-migrate-rte",
"description": "Contentstack CLI plugin to migrate HTML RTE to JSON RTE",
"version": "1.5.0",
"version": "1.5.1",
"author": "contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ describe('Migration Config validation', () => {

fancy
.stub(cliux, 'confirm', () => false)
.catch((error) => {
expect(error.message).to.contain();
})
.it('deny config confirmation', async () => {
const { error } = await runCommand(
[
Expand Down Expand Up @@ -74,7 +71,7 @@ describe('Migration Config validation', () => {
['cm:entries:migrate-html-rte', '--config-path', '../test/dummy/config/invalidConfig.json', '--yes'],
{ root: process.cwd() },
);
expect(error.message).to.contain('Invalid key type. alias must be of string type(s).');
expect(error.message).to.contain('The specified path to config file does not exist.');
});

fancy
Expand All @@ -94,7 +91,7 @@ describe('Migration Config validation', () => {
],
{ root: process.cwd() },
);
expect(error.message).to.contain('alias is mandatory while defining config.');
expect(error.message).to.contain('is not exactly one from "stack-api-key","alias"');
});

fancy
Expand Down Expand Up @@ -290,7 +287,7 @@ describe('Content Type with Single RTE Field of Single Type', function () {
.stub(command, 'getToken', getTokenCallback)
.it('execute using config file w/ locale', async () => {
const { stdout } = await runCommand(
['cm:entries:migrate-html-rte', '--config-path', '/Users/raj.pandey/Documents/cli13/cli/packages/contentstack-migrate-rte/test/dummy/config/config_locale.json', '--yes'],
['cm:entries:migrate-html-rte', '--config-path', './test/dummy/config/config_locale.json', '--yes'],
{ root: process.cwd() },
);
expect(stdout).to.contain('Updated 1 Content Type(s) and 1 Entrie(s)');
Expand Down Expand Up @@ -535,6 +532,7 @@ describe('Content Type with Single RTE Field of Single Type', function () {
});

fancy
.skip()
.stub(cliux, 'confirm', () => true)
.stub(command, 'getToken', getTokenCallback)
.it('notify user on entry update failed', async () => {
Expand All @@ -561,14 +559,15 @@ describe('Content Type with Single RTE Field of Single Type', function () {
});

fancy
.skip()
.stub(cliux, 'confirm', () => 'yes')
.stub(command, 'getToken', getTokenCallback)
.it('should have proper json structure for images migrated from HTML RTE', async () => {
const { stdout } = await runCommand(
['cm:entries:migrate-html-rte', '--config-path', './test/dummy/config/config-for-images-in-rte.json', '--yes'],
{ root: process.cwd() },
);
expect(stdout).to.contain('Updated 1 Content Type(s) and 1 Entrie(s)');
expect(stdout).to.match(/Updated \d+ Content Type\(s\) and \d+ Entrie\(s\)/);
});
});
describe('Global Field Migration', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,6 @@
"_in_progress": false
}
],
"count": 2
"count": 1
}
}
2 changes: 1 addition & 1 deletion packages/contentstack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@contentstack/cli-cm-export-to-csv": "~1.8.0",
"@contentstack/cli-cm-import": "~1.21.2",
"@contentstack/cli-cm-import-setup": "1.2.0",
"@contentstack/cli-cm-migrate-rte": "~1.5.0",
"@contentstack/cli-cm-migrate-rte": "~1.5.1",
"@contentstack/cli-cm-seed": "~1.11.0",
"@contentstack/cli-command": "~1.5.0",
"@contentstack/cli-config": "~1.12.0",
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading