From 5002e2cd9cf3cb835a6e728d87ab9d7d9a104bf2 Mon Sep 17 00:00:00 2001 From: tkt <37575408+tktcorporation@users.noreply.github.com> Date: Mon, 10 Oct 2022 13:20:23 +0000 Subject: [PATCH] :sparkles: finish https://redwoodjs.com/docs/tutorial/chapter7/rbac#mocking-currentuser-for-storybook --- .../components/Comment/Comment.stories.tsx | 41 +++++++++++++++---- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/web/src/components/Comment/Comment.stories.tsx b/web/src/components/Comment/Comment.stories.tsx index 83dea125e..0cbe60ba2 100644 --- a/web/src/components/Comment/Comment.stories.tsx +++ b/web/src/components/Comment/Comment.stories.tsx @@ -1,14 +1,39 @@ import Comment from './Comment' -export const generated = () => { +export const defaultView = () => { return ( - +
+ +
+ ) +} + +export const moderatorView = () => { + mockCurrentUser({ + roles: 'moderator', + id: 1, + email: 'moderator@moderator.com', + }) + return ( +
+ +
) }