Skip to content
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

Merged
merged 11 commits into from
Sep 16, 2020

Conversation

imnasnainaec
Copy link
Collaborator

@imnasnainaec imnasnainaec commented Aug 25, 2020

Resolves #454


This change is Reviewable

@imnasnainaec imnasnainaec self-assigned this Aug 25, 2020
Copy link
Contributor

@jasonleenaylor jasonleenaylor left a 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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec)

@jasonleenaylor
Copy link
Contributor


src/components/AppBar/UserMenu.tsx, line 40 at r1 (raw file):

React.useEffect(() => {
    getIsAdmin();
  }, []);

enlighten me. What exactly did this try to do before?

@imnasnainaec imnasnainaec marked this pull request as ready for review September 15, 2020 16:22
Copy link
Contributor

@jasonleenaylor jasonleenaylor left a 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. :)

Copy link
Contributor

@jasonleenaylor jasonleenaylor left a 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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec)

Copy link
Collaborator Author

@imnasnainaec imnasnainaec left a 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?

Copy link
Contributor

@jasonleenaylor jasonleenaylor left a 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: :shipit: complete! all files reviewed, all discussions resolved

@imnasnainaec imnasnainaec merged commit 6430a84 into master Sep 16, 2020
@imnasnainaec imnasnainaec deleted the user-menu-unit-testing branch September 16, 2020 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User Menu / Site Settings needs unit testing
3 participants