Skip to content

Commit

Permalink
Testing Mock Dialog
Browse files Browse the repository at this point in the history
Signed-off-by: vr-varad <[email protected]>
  • Loading branch information
vr-varad committed Nov 16, 2024
1 parent 5319d1b commit 1cb8424
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
7 changes: 1 addition & 6 deletions packages/testing/__test__/command.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
21 changes: 21 additions & 0 deletions packages/testing/__test__/dialog.spec.ts
Original file line number Diff line number Diff line change
@@ -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);
});

});

0 comments on commit 1cb8424

Please sign in to comment.