-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: renterd dialogs, bucket policy, delete
- Loading branch information
1 parent
64da64b
commit d7a19d5
Showing
18 changed files
with
126 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'renterd': patch | ||
--- | ||
|
||
Fixed an issue where selecting a bucket context menu option would also navigate into the bucket. Closes https://github.com/SiaFoundation/renterd/issues/1277 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'renterd': patch | ||
--- | ||
|
||
Fixed an issue that broke some dialogs including the bucket policy and bucket delete dialogs. Closes https://github.com/SiaFoundation/renterd/issues/1277 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Page, expect } from '@playwright/test' | ||
import { navigateToBuckets } from './navigateToBuckets' | ||
import { fillTextInputByName } from './textInput' | ||
import { clearToasts } from './clearToasts' | ||
|
||
export async function createBucket(page: Page, name: string) { | ||
await navigateToBuckets({ page }) | ||
await expect(page.getByTestId('navbar').getByText('Buckets')).toBeVisible() | ||
await page.getByText('Create bucket').click() | ||
await fillTextInputByName(page, 'name', name) | ||
await page.locator('input[name=name]').press('Enter') | ||
await expect(page.getByRole('dialog')).toBeHidden() | ||
await expect(page.getByText('Bucket created')).toBeVisible() | ||
await clearToasts({ page }) | ||
await expect(page.getByRole('cell', { name })).toBeVisible() | ||
} | ||
|
||
export async function deleteBucket(page: Page, name: string) { | ||
await openBucketContextMenu(page, name) | ||
await page.getByRole('menuitem', { name: 'Delete bucket' }).click() | ||
await fillTextInputByName(page, 'name', name) | ||
await page.locator('input[name=name]').press('Enter') | ||
await expect(page.getByRole('dialog')).toBeHidden() | ||
await bucketNotInList(page, name) | ||
} | ||
|
||
export async function deleteBucketIfExists(page: Page, name: string) { | ||
const doesBucketExist = await page | ||
.getByRole('table') | ||
.getByText(name) | ||
.isVisible() | ||
if (doesBucketExist) { | ||
await deleteBucket(page, name) | ||
} | ||
} | ||
|
||
export async function openBucketContextMenu(page: Page, name: string) { | ||
await page.getByRole('row', { name }).getByRole('button').first().click() | ||
} | ||
|
||
export async function bucketInList(page: Page, name: string) { | ||
await expect(page.getByRole('table').getByText(name)).toBeVisible() | ||
} | ||
|
||
export async function bucketNotInList(page: Page, name: string) { | ||
await expect(page.getByRole('table').getByText(name)).toBeHidden() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { test, expect } from '@playwright/test' | ||
import { navigateToBuckets } from '../fixtures/navigateToBuckets' | ||
import { login } from '../fixtures/login' | ||
import { | ||
bucketInList, | ||
createBucket, | ||
deleteBucket, | ||
deleteBucketIfExists, | ||
openBucketContextMenu, | ||
} from '../fixtures/buckets' | ||
|
||
test('can change a buckets policy', async ({ page }) => { | ||
await login({ page }) | ||
await navigateToBuckets({ page }) | ||
await openBucketContextMenu(page, 'default') | ||
await page.getByRole('menuitem', { name: 'Change policy' }).click() | ||
await page.getByRole('heading', { name: 'Change Policy: default' }).click() | ||
await page.getByRole('combobox').selectOption('public') | ||
await page.getByRole('button', { name: 'Update policy' }).click() | ||
await expect(page.getByText('Bucket policy has been updated')).toBeVisible() | ||
await bucketInList(page, 'default') | ||
}) | ||
|
||
test('can create and delete a bucket', async ({ page }) => { | ||
await login({ page }) | ||
await deleteBucketIfExists(page, 'my-new-bucket') | ||
await createBucket(page, 'my-new-bucket') | ||
await deleteBucket(page, 'my-new-bucket') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters