Commit 780b67b6 authored by samy's avatar samy
Browse files

Fix callback tests and replace test descriptions

Replace test descriptions 'should not call callback with actual status' with 'should not call callback with incorrect value of status'
Replace test description 'should not call callback with actual final' with 'should not call callback when final value is incorrect'
Replace 'toHaveBeenCalledWith' with 'toHaveBeenCalled()' to test that the callback has not been called at all
parent b404512d
......@@ -77,7 +77,7 @@ describe('client/lib/stt', () => {
text: 'this is a transcript'
}));
});
test('should not call callback with actual status', () => {
test('should not call callback with incorrect value of status', () => {
const stt = global.robotLib.stt(config);
const callback = jest.fn();
const ws = stt.getTranscriptSocket(callback);
......@@ -97,11 +97,9 @@ describe('client/lib/stt', () => {
data: JSON.stringify(dataContent)
});
expect(callback).not.toHaveBeenCalledWith(expect.objectContaining({
status: 0
}));
expect(callback).not.toHaveBeenCalled();
});
test('should not call callback with actual final', () => {
test('should not call callback when final value is incorrect', () => {
const stt = global.robotLib.stt(config);
const callback = jest.fn();
const ws = stt.getTranscriptSocket(callback);
......@@ -121,8 +119,6 @@ describe('client/lib/stt', () => {
data: JSON.stringify(dataContent)
});
expect(callback).not.toHaveBeenCalledWith(expect.objectContaining({
final: false
}));
expect(callback).not.toHaveBeenCalled();
});
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment