mirror of
https://github.com/balzack/databag.git
synced 2025-03-13 00:50:03 +00:00
adding unit test for focus module
This commit is contained in:
parent
58ac9342b5
commit
d01565d3b6
27
app/sdk/__tests__/focus.tests.ts
Normal file
27
app/sdk/__tests__/focus.tests.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import { FocusModule } from '../src/focus';
|
||||
import { NoStore } from '../src/store';
|
||||
import { ConsoleLogging } from '../src/logging';
|
||||
import { waitFor } from '../__mocks__/waitFor';
|
||||
|
||||
jest.mock('../src/net/fetchUtil', () => {
|
||||
const fn = jest.fn().mockImplementation((url: string, options: { method: string, body: string }) => {
|
||||
});
|
||||
|
||||
return {
|
||||
fetchWithTimeout: fn,
|
||||
checkResponse: () => {},
|
||||
}
|
||||
});
|
||||
|
||||
class TestStore extends NoStore {
|
||||
}
|
||||
|
||||
test('focus module works', async () => {
|
||||
const log = new ConsoleLogging();
|
||||
const store = new TestStore();
|
||||
const connection = { node: 'test_node', secure: false, token: 'test_token' };
|
||||
const markRead = async () => {};
|
||||
const flagTopic = async (id: string) => {};
|
||||
const focus = new FocusModule(log, store, null, null, null, 'test_channel_id', 'my_guid', connection, null, false, 1, markRead, flagTopic);
|
||||
await focus.close();
|
||||
});
|
Loading…
Reference in New Issue
Block a user