Updated unit test
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
4ac207c568
commit
b34e5804ae
|
@ -8,7 +8,17 @@ describe('Chat notifyIssue()', () => {
|
|||
const chatModel = app.models.Chat;
|
||||
const departmentId = 31;
|
||||
|
||||
it(`should call to notifyIssue() method then return a response calling the send() method`, async() => {
|
||||
it(`should not call to the send() method and neither return a response`, async() => {
|
||||
spyOn(chatModel, 'send').and.callThrough();
|
||||
spyOn(chatModel, 'rawSql').and.returnValue([]);
|
||||
|
||||
const response = await chatModel.notifyIssues(ctx);
|
||||
|
||||
expect(chatModel.send).not.toHaveBeenCalled();
|
||||
expect(response).toBeUndefined();
|
||||
});
|
||||
|
||||
it(`should return a response calling the send() method`, async() => {
|
||||
spyOn(chatModel, 'send').and.callThrough();
|
||||
spyOn(chatModel, 'rawSql').and.returnValue([{title: 'Issue title'}]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue