-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[UserMenu] Unit tests: SiteSettings only visible to admins #641
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec)
src/components/AppBar/UserMenu.tsx, line 40 at r1 (raw file):
enlighten me. What exactly did this try to do before? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r2.
Reviewable status: 1 of 2 files reviewed, all discussions resolved (waiting on @imnasnainaec and @jasonleenaylor)
src/components/AppBar/tests/UserMenu.test.tsx, line 43 at r2 (raw file):
}); it("should only show site settings to general users", async () => {
maybe something here or in a comment below should mention what the extra admin menu item is. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 2 files reviewed, all discussions resolved (waiting on @jasonleenaylor)
src/components/AppBar/UserMenu.tsx, line 40 at r1 (raw file):
Previously, jasonleenaylor (Jason Naylor) wrote…
React.useEffect(() => { getIsAdmin(); }, []);
enlighten me. What exactly did this try to do before?
I think useEffect
is triggered on render, and that was unnecessary in this context.
src/components/AppBar/tests/UserMenu.test.tsx, line 43 at r2 (raw file):
Previously, jasonleenaylor (Jason Naylor) wrote…
maybe something here or in a comment below should mention what the extra admin menu item is. :)
Ah, my description was backwards. Better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3.
Reviewable status: complete! all files reviewed, all discussions resolved
Resolves #454
This change is