Skip to content

Commit

Permalink
#9 set status to empty string since there will be no undefined from a…
Browse files Browse the repository at this point in the history
…ctions core input
  • Loading branch information
Keerthi Shankar Subramanian committed Apr 10, 2022
1 parent 59cd3af commit 1f2f34d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ const main = require('./main');

describe('Main:', () => {
test('Throws when not a valid webhook url', async () => {
await expect(main('foo', '', {})).rejects.toThrow('Webhook url is not a valid url');
await expect(main('foo', '', { status: '' })).rejects.toThrow('Webhook url is not a valid url');
});
});
4 changes: 2 additions & 2 deletions test/http-request-tests/message-with-job-status.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ describe('Post message with job status', () => {

test('Send a long message with no status', async () => {
const messageToSend = 'Long message with no status. With label message published SDK version of container 0.1.1 (major) version. Pushed the container to docker registry and artifactory';
let response = await main(_teamsIncomingHookUrl, messageToSend, {});
let response = await main(_teamsIncomingHookUrl, messageToSend, {status: ''});
expect(response).toBe(responseBody);
});

test('Send a short message with no status', async () => {
const messageToSend = 'Short message with no status';
let response = await main(_teamsIncomingHookUrl, messageToSend, {});
let response = await main(_teamsIncomingHookUrl, messageToSend, {status: ''});
expect(response).toBe(responseBody);
});
});
4 changes: 2 additions & 2 deletions test/http-request-tests/url-buttons.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('Post message with job status', () => {
test('Both buttons to be visible with no status', async () => {
process.env = Object.assign(process.env, { [SHOULD_DISPLAY_VIEW_COMMIT_BUTTON]: 'true', [SHOULD_DISPLAY_VIEW_RUN_BUTTON]: 'true' });
const messageToSend = 'Both buttons to be visible with no status';
let response = await main(_teamsIncomingHookUrl, messageToSend, {});
let response = await main(_teamsIncomingHookUrl, messageToSend, { status: '' });
expect(response).toBe(responseBody);
});

Expand Down Expand Up @@ -61,7 +61,7 @@ describe('Post message with job status', () => {
test('Send a long message with one of the buttons', async () => {
process.env = Object.assign(process.env, { [SHOULD_DISPLAY_VIEW_RUN_BUTTON]: 'true', });
const messageToSend = 'Long message with no status status along with view run button. With status message published SDK version of container 14.1.1 (major) version. Pushed the container to docker registry and artifactory';
let response = await main(_teamsIncomingHookUrl, messageToSend, {});
let response = await main(_teamsIncomingHookUrl, messageToSend, { status: '' });
expect(response).toBe(responseBody);
});

Expand Down

0 comments on commit 1f2f34d

Please sign in to comment.