(Story: FC, { parameters }: StoryContext)
| 157 | ); |
| 158 | |
| 159 | export const withAuthProvider = (Story: FC, { parameters }: StoryContext) => { |
| 160 | if (!parameters.user) { |
| 161 | throw new Error("You forgot to add `parameters.user` to your story"); |
| 162 | } |
| 163 | const queryClient = useQueryClient(); |
| 164 | queryClient.setQueryData(meKey, parameters.user); |
| 165 | queryClient.setQueryData(hasFirstUserKey, true); |
| 166 | queryClient.setQueryData( |
| 167 | getAuthorizationKey({ checks: permissionChecks }), |
| 168 | parameters.permissions ?? {}, |
| 169 | ); |
| 170 | |
| 171 | return ( |
| 172 | <AuthProvider> |
| 173 | <Story /> |
| 174 | </AuthProvider> |
| 175 | ); |
| 176 | }; |
| 177 | |
| 178 | export const withToaster = (Story: FC) => ( |
| 179 | <> |
nothing calls this directly
no test coverage detected