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

Action Buttons that manipulate a form are only visible to the owner #96

Merged
merged 11 commits into from
Feb 7, 2024

Conversation

PascalinDe
Copy link
Member

@PascalinDe PascalinDe commented Feb 6, 2024

This PR makes sure that action buttons to manipulate a form are only visible to the owner of the form.

closes #80

@PascalinDe PascalinDe self-assigned this Feb 6, 2024
Copy link
Member

@ineiti ineiti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one questions...

@@ -74,3 +81,77 @@ async function assertIsOnlyVisibleToOwnerStates(page: page, locator: locator, st
test('Assert "Add voters" button is only visible to owner', async ({ page }) => {
await assertIsOnlyVisibleToOwnerStates(page, page.getByTestId('addVotersButton'), [0, 1]);
});

test('Assert "Initialize" button is only visible to owner', async ({ page }) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lazy review: are there positive tests on the buttons where it checks that the buttons are available?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not yet, that's why it closes #80 and not #72 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or at least not all of them - e.g. it checks that the buttons that are should only be visible to owner are:

  • not visible to unauthenticated
  • not visible to non-owner user
  • not visible to non-owner admin
  • visible to owner

but it does not e.g. check that the "Vote" button is visible for voters

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also it checks only in specific states, e.g. it does not verify that the buttons are not displayed in other states where they are not applicable at all

@PascalinDe PascalinDe merged commit 0d353b8 into main Feb 7, 2024
11 checks passed
@PascalinDe PascalinDe deleted the playwright branch February 7, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

hide action buttons from non-owner of form
2 participants