diff --git a/extension/test/integration/7 - notification-provider.test.ts b/extension/test/integration/7 - notification-provider.test.ts new file mode 100644 index 00000000..90dc6dc8 --- /dev/null +++ b/extension/test/integration/7 - notification-provider.test.ts @@ -0,0 +1,42 @@ +import * as vscode from 'vscode' +import * as sinon from 'sinon' +import { StorageProvider } from "../../src/storage/storage-provider" +import { NotificationProvider } from "../../src/ui/notification-provider" + +suite('notificaitons tests', () => { + let mockGlobalState: vscode.Memento + let storage: StorageProvider + let notifications: NotificationProvider + + let fetchSpy: sinon.SinonSpy + let promptSpy: { + info: sinon.SinonSpy + warning: sinon.SinonSpy + error: sinon.SinonSpy + } + + beforeEach(async function () { + this.timeout(5000) + + let state = new Map() + mockGlobalState = { + get: (key: string) => state.get(key), + update: (key: string, value: any) => state.set(key, value), + } as any + storage = new StorageProvider(mockGlobalState) + notifications = new NotificationProvider(storage) + + fetchSpy = sinon.stub(globalThis, 'fetch') + promptSpy = { + info: sinon.stub(vscode.window, 'showInformationMessage'), + warning: sinon.stub(vscode.window, 'showWarningMessage'), + error: sinon.stub(vscode.window, 'showErrorMessage'), + } + }) + + test('notifications are displayed', async function () { + this.timeout(5000) + + notifications.activate() + }) +}) \ No newline at end of file