Skip to content

Commit

Permalink
feat: add clone locale and rollback smapi commands
Browse files Browse the repository at this point in the history
  • Loading branch information
kakha urigashvili authored and RonWang committed Jul 21, 2020
1 parent a72aa41 commit a0ce145
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"dependencies": {
"adm-zip": "^0.4.13",
"archiver": "^1.1.0",
"ask-smapi-model": "1.9.3",
"ask-smapi-model": "1.10.0",
"ask-smapi-sdk": "^1.2.0",
"async": "^2.1.5",
"aws-profile-handler": "2.0.3",
Expand Down
40 changes: 40 additions & 0 deletions test/integration/commands/smapi-commands-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ parallel('smapi command test', () => {
const stage = 'development';
const locale = 'en-US';
const location = 'US';
const sourceLocale = 'en-US';
const targetLocales = 'en-GB';
const cloneLocaleRequestId = 'someCloneLocaleRequestId';
const uploadId = 'someUploadId';
const subscriberId = 'someSubscriberId';
const subscriptionId = 'someSubscriptionId';
const updateRequestId = 'someUpdateRequestId';
const version = '2.0.0';
const targetVersion = '7';
const rollbackRequestId = 'someRollbackRequestId';
const simulationId = 'someSimulationId';
const slotTypeId = 'someSlotTypeId';
const sourceAnnotationId = 'someSourceAnnotationId';
Expand Down Expand Up @@ -1097,6 +1102,41 @@ parallel('smapi command test', () => {
expect(result).be.an('object');
});

it('| should clone locale', async () => {
const args = [subCmd, 'clone-locale', '-s', skillId, '--source-locale', sourceLocale, '--target-locales', targetLocales];
addCoveredCommand(args);
const result = await run(cmd, args, { ...options, parse: false });
expect(result).include('Command executed successfully!');
});

it('| should get clone locale status', async () => {
const args = [subCmd, 'get-clone-locale-status', '-s', skillId, '--clone-locale-request-id', cloneLocaleRequestId];
addCoveredCommand(args);
const result = await run(cmd, args, options);
expect(result).be.an('object');
});

it('| should list versions for skill', async () => {
const args = [subCmd, 'list-versions-for-skill', '-s', skillId];
addCoveredCommand(args);
const result = await run(cmd, args, options);
expect(result).be.an('object');
});

it('| should rollback skill', async () => {
const args = [subCmd, 'rollback-skill', '-s', skillId, '--target-version', targetVersion];
addCoveredCommand(args);
const result = await run(cmd, args, options);
expect(result).be.an('object');
});

it('| should get rollback for skill', async () => {
const args = [subCmd, 'get-rollback-for-skill', '-s', skillId, '--rollback-request-id', rollbackRequestId];
addCoveredCommand(args);
const result = await run(cmd, args, options);
expect(result).be.an('object');
});

after(() => {
mockSmapiServer.kill();
mockLwaServer.kill();
Expand Down

0 comments on commit a0ce145

Please sign in to comment.