Skip to content

Commit

Permalink
address reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
SwikritiT committed Aug 29, 2022
1 parent 3c12905 commit 392c8c7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Feature: spaces public link
| Carol | viewer |
| Marie | manager |
And "Alice" logs out
And "Brian" logs in
When "Brian" logs in
And "Brian" navigates to the projects space page
And "Brian" navigates to the project space "team.1"
Then public link named "spaceLink" should be visible to "Brian"
Expand All @@ -38,15 +38,13 @@ Feature: spaces public link
When "Marie" logs in
And "Marie" navigates to the projects space page
And "Marie" navigates to the project space "team.1"
Then public link named "spaceLink" should be visible to "Marie"
And "Marie" should be able to edit the public link named "spaceLink"
When "Marie" edits the public link named "spaceLink" of the space changing role to "editor"
Then public link named "folderLink" of the resource "spaceFolder" should be visible to "Marie"
And "Marie" should be able to edit the public link named "folderLink"
When "Marie" edits the public link named "folderLink" of resource "spaceFolder" changing role to "editor"
And "Marie" edits the public link named "spaceLink" of the space changing role to "editor"
And "Marie" edits the public link named "folderLink" of resource "spaceFolder" changing role to "editor"
And "Marie" logs out
When "Carol" logs in
And "Carol" navigates to the projects space page
And "Carol" navigates to the project space "team.1"
Then public link named "folderLink" of the resource "spaceFolder" should be visible to "Carol"
And public link named "spaceLink" should be visible to "Carol"
But "Carol" should not be able to edit the public link named "spaceLink"
And public link named "folderLink" of the resource "spaceFolder" should be visible to "Carol"
And "Carol" logs out
21 changes: 12 additions & 9 deletions tests/e2e/support/objects/app-files/link/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,18 @@ export const waitForPopupNotPresent = async (page): Promise<void> => {

export const changeRole = async (args: changeRoleArgs): Promise<string> => {
const { page, resource, linkName, role, space } = args
let shareType = 'space-share'
let resourceName = null
if (!space) {
const resourcePaths = resource.split('/')
const resourceName = resourcePaths.pop()
resourceName = resourcePaths.pop()
shareType = 'sharing'
if (resourcePaths.length) {
await clickResource({ page: page, path: resourcePaths.join('/') })
}
await sidebar.open({ page: page, resource: resourceName })
await sidebar.openPanel({ page: page, name: 'sharing' })
}
await sidebar.open({ page: page, resource: resourceName })
await sidebar.openPanel({ page: page, name: shareType })
await page.locator(util.format(publicLinkEditRoleButton, linkName)).click()
await page.locator(util.format(publicLinkSetRoleButton, role.toLowerCase())).click()
const message = await page.locator(linkUpdateDialog).textContent()
Expand Down Expand Up @@ -196,18 +199,18 @@ export const getPublicLinkVisibility = async (
args: publicLinkAndItsEditButtonVisibilityArgs
): Promise<string> => {
const { page, linkName, resource, space } = args
let shareType = 'space-share'
let resourceName = null
if (!space) {
shareType = 'sharing'
const resourcePaths = resource.split('/')
const resourceName = resourcePaths.pop()
resourceName = resourcePaths.pop()
if (resourcePaths.length) {
await clickResource({ page: page, path: resourcePaths.join('/') })
}
await sidebar.open({ page: page, resource: resourceName })
await sidebar.openPanel({ page: page, name: 'sharing' })
} else {
await sidebar.open({ page: page })
await sidebar.openPanel({ page: page, name: 'space-share' })
}
await sidebar.open({ page: page, resource: resourceName })
await sidebar.openPanel({ page: page, name: shareType })
return await page.locator(util.format(publicLink, linkName)).textContent()
}

Expand Down

0 comments on commit 392c8c7

Please sign in to comment.