-
Notifications
You must be signed in to change notification settings - Fork 9
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 16e89c5
Showing
17 changed files
with
132 additions
and
29 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,43 @@ | ||
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) { | ||
// Open bucket context menu. | ||
await page.getByRole('row', { name }).getByRole('button').first().click() | ||
|
||
// Open delete bucket dialog. | ||
await page.getByRole('menuitem', { name: 'Delete bucket' }).click() | ||
|
||
// Assert bucket name is correct. | ||
await fillTextInputByName(page, 'name', name) | ||
await page.locator('input[name=name]').press('Enter') | ||
await expect(page.getByRole('dialog')).toBeHidden() | ||
|
||
// Assert bucket is deleted. | ||
await expect(page.getByRole('table').getByText(name)).toBeHidden() | ||
} | ||
|
||
export async function deleteBucketIfExists(page: Page, name: string) { | ||
const doesBucketExist = await page | ||
.getByRole('table') | ||
.getByText(name) | ||
.isVisible() | ||
if (doesBucketExist) { | ||
await deleteBucket(page, name) | ||
} | ||
} |
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,40 @@ | ||
import { test, expect } from '@playwright/test' | ||
import { navigateToBuckets } from '../fixtures/navigateToBuckets' | ||
import { login } from '../fixtures/login' | ||
import { | ||
createBucket, | ||
deleteBucket, | ||
deleteBucketIfExists, | ||
} from '../fixtures/buckets' | ||
|
||
test('can change a buckets policy', async ({ page }) => { | ||
await login({ page }) | ||
await navigateToBuckets({ page }) | ||
|
||
// Open default bucket context menu. | ||
await page | ||
.getByRole('row', { name: 'default' }) | ||
.getByRole('button') | ||
.first() | ||
.click() | ||
|
||
// Open change policy dialog. | ||
await page.getByRole('menuitem', { name: 'Change policy' }).click() | ||
|
||
// Assert bucket name is correct. | ||
// await page.getByRole('heading', { name: 'Change Policy: default' }).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() | ||
|
||
// Assert still viewing buckets list. | ||
await expect(page.getByRole('table').getByText('default')).toBeVisible() | ||
}) | ||
|
||
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