Skip to content

Commit

Permalink
Merge pull request #65 from atlassian-labs/disable-hydrate-client-onl…
Browse files Browse the repository at this point in the history
…y-followup

Follow-up changes from "Disable the Hydrate task on client only configs" (#58)
  • Loading branch information
AndrewOCC authored Jan 14, 2021
2 parents 6a9876f + 9139143 commit fae51a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/tasks/get-groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export function getGroups({
result.push(server);
}
if (allowedGroups.includes('client')) {
// Hydration, although run client-side, relies on renderToString and
// should not be run if the plugin is configured to be client-only
const tasks = allowedGroups.includes('server')
? client.tasks
: client.tasks.filter((task) => task.name !== 'Hydrate');
Expand Down
2 changes: 1 addition & 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, debug } = render(
const { container, queryByText } = render(
<WithStorybookTheme>
<Panel interactions={[]} channel={channel} allowedGroups={['client']} />
</WithStorybookTheme>,
Expand Down

0 comments on commit fae51a0

Please sign in to comment.