Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bolchowka committed Jun 28, 2024
1 parent b462b2d commit 9c9cb09
Showing 1 changed file with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,44 @@ describe('FullscreenWidget', () => {
null
);
});

it('has a `navigate` method', () => {
const connection = createMockConnection();
const widget = FullscreenWidget(connection);

expect(widget.navigate).toBeDefined();
});

it('`navigate` works correctly', () => {
const connection = createMockConnection();
const widget = FullscreenWidget(connection);

const path = '/some-path';
widget.navigate(path);
expect(connection.sendMessage).toHaveBeenCalledWith(
'navigate_from_fullscreen_widget',
path
);
});

it('has a `setReportsFilters` method', () => {
const connection = createMockConnection();
const widget = FullscreenWidget(connection);

expect(widget.setReportsFilters).toBeDefined();
});

it('`setReportsFilters` works correctly', () => {
const connection = createMockConnection();
const widget = FullscreenWidget(connection);

const filters = { stringFilter: 'value', numberFilter: 5 };
widget.setReportsFilters(filters);
expect(connection.sendMessage).toHaveBeenCalledWith(
'set_reports_filters',
filters
);
});
});

describe('createFullscreenWidget', () => {
Expand Down

0 comments on commit 9c9cb09

Please sign in to comment.