Skip to content
Open
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
6 changes: 0 additions & 6 deletions packages/contentstack-auth/src/commands/auth/tokens/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ export default class TokensAddCommand extends BaseCommand<typeof TokensAddComman
description: 'Add the token name',
env: 'TOKEN',
}),
branch: flags.string({
required: false,
multiple: false,
description: 'Branch name',
hidden: true,
}),
};

static usage =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,6 @@ describe('Management and Delivery token flags', () => {
conf.validAPIKey,
'--token',
conf.validToken,
'--branch',
'main',
]);

assert.calledOnce(successStub);
Expand All @@ -270,24 +268,6 @@ describe('Management and Delivery token flags', () => {
}
});

it.skip('Should add a token successfully after all the values are passed with stack having branches enabled', async () => {
nock('https://api.contentstack.io').get('/v3/environments').query({ limit: 1 }).reply(200, { environments: [] });

await TokensAddCommand.run([
'--management',
'--alias',
'newToken',
'--stack-api-key',
conf.validAPIKey,
'--token',
conf.validToken,
'--branch',
'main',
]);

assert.calledOnce(successStub);
});

it.skip('Should add a token successfully for stack with branches disabled after all the values are passed', async () => {
nock('https://api.contentstack.io').get('/v3/environments').query({ limit: 1 }).reply(200, { environments: [] });

Expand Down Expand Up @@ -364,25 +344,5 @@ describe('Management and Delivery token flags', () => {
]);
assert.calledWith(successStub, 'CLI_AUTH_TOKENS_ADD_SUCCESS');
});
it('Should throw and error for stack with branches disabled', async () => {
let branch = 'my-branch';
try {
await TokensAddCommand.run([
'--delivery',
'--alias',
'newToken',
'--stack-api-key',
process.env.BRANCH_DISABLED_API_KEY!,
'--token',
process.env.BRANCH_DISABLED_DELIVERY_TOKEN!,
'--environment',
process.env.BRANCH_DISABLED_ENVIRONMENT!,
'--branch',
branch,
]);
} catch (error: any) {
assert.calledOnce(errorStub);
}
});
});
});
Loading