-
Notifications
You must be signed in to change notification settings - Fork 2
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
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.
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 }) => { |
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.
Lazy review: are there positive tests on the buttons where it checks that the buttons are available?
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.
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.
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
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.
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
This PR makes sure that action buttons to manipulate a form are only visible to the owner of the form.
closes #80