Skip to content

Commit

Permalink
test: cover logic for disabling Hydrate in client only configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Metral committed Dec 28, 2020
1 parent ff0835c commit 4dfc439
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/panel/group-filtering.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import server from '../../src/tasks/preset/server';
it('should allow filtering of tasks (client only)', () => {
// 1: Initial render
const channel: Channel = new Channel({ async: false });
const { container, queryByText } = render(
const { container, queryByText, debug } = render(
<WithStorybookTheme>
<Panel interactions={[]} channel={channel} allowedGroups={['client']} />
</WithStorybookTheme>,
Expand All @@ -37,6 +37,14 @@ it('should allow filtering of tasks (client only)', () => {

expect(queryByText(client.name)).toBeTruthy();
expect(queryByText(server.name)).toBeFalsy();

// All tasks should be rendered except Hydrate (see #57)
expect(queryByText('Hydrate')).toBeFalsy();
client.tasks.forEach((task) => {
if (task.name !== 'Hydrate') {
expect(queryByText(task.name)).toBeTruthy();
}
});
});

it('should allow filtering of tasks (server only)', () => {
Expand Down Expand Up @@ -64,4 +72,7 @@ it('should allow filtering of tasks (server only)', () => {

expect(queryByText(client.name)).toBeFalsy();
expect(queryByText(server.name)).toBeTruthy();
server.tasks.forEach((task) => {
expect(queryByText(task.name)).toBeTruthy();
});
});

0 comments on commit 4dfc439

Please sign in to comment.