From 1cb84243ca95a06116ec41d0bde10e43ecadc8c8 Mon Sep 17 00:00:00 2001 From: vr-varad Date: Sat, 16 Nov 2024 14:56:22 +0530 Subject: [PATCH] Testing Mock Dialog Signed-off-by: vr-varad --- packages/testing/__test__/command.spec.ts | 7 +------ packages/testing/__test__/dialog.spec.ts | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 packages/testing/__test__/dialog.spec.ts diff --git a/packages/testing/__test__/command.spec.ts b/packages/testing/__test__/command.spec.ts index e5f9350..75e3166 100644 --- a/packages/testing/__test__/command.spec.ts +++ b/packages/testing/__test__/command.spec.ts @@ -21,11 +21,6 @@ describe('Commands Mock', () => { }); test('should throw error to handle non-existent command ', async () => { - try { - await command.invoke('unknown'); - } catch (error) { - expect(error).toBeDefined(); - expect(error.message).toMatch('Command unknown not found'); // Adjust error handling based on implementation - } + expect(yasumu.command.invoke('unknown')).rejects.toThrowError('Command unknown not found'); }); }); diff --git a/packages/testing/__test__/dialog.spec.ts b/packages/testing/__test__/dialog.spec.ts new file mode 100644 index 0000000..32f1f82 --- /dev/null +++ b/packages/testing/__test__/dialog.spec.ts @@ -0,0 +1,21 @@ +import { yasumu } from '../src'; +import { describe, test, expect } from 'vitest'; + +describe('Dialog', () => { + const dialog = yasumu.dialog; + + test('should open a dialog', async () => { + const result = await dialog.open({ + title: 'Test', + }); + expect(result).toBe(null); + }); + + test('should save a dialog', async () => { + const result = await dialog.save({ + title: 'Test', + }); + expect(result).toBe(null); + }); + +});