-
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.
refactor(renterd): remove default bucket
- Loading branch information
1 parent
054a763
commit 6ef4cb5
Showing
26 changed files
with
393 additions
and
78 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': minor | ||
--- | ||
|
||
The bucket list now has an empty state. |
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': minor | ||
--- | ||
|
||
The cmdk menu now has an two separate files search options, one for across all buckets and one for the current 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'renterd': minor | ||
--- | ||
|
||
It is now possible to delete a bucket named 'default'. |
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': minor | ||
--- | ||
|
||
The file search feature can now search across all buckets. |
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,10 @@ | ||
import { Page, expect } from '@playwright/test' | ||
|
||
export async function openCmdkMenu(page: Page) { | ||
const isMac = process.platform === 'darwin' | ||
const modifier = isMac ? 'Meta' : 'Control' | ||
await page.keyboard.press(`${modifier}+k`) | ||
const dialog = page.getByRole('dialog') | ||
await expect(dialog.locator('div[cmdk-root]')).toBeVisible() | ||
return dialog | ||
} |
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,124 @@ | ||
import { expect, test } from '@playwright/test' | ||
import { navigateToBuckets } from '../fixtures/navigate' | ||
import { createBucket, openBucket } from '../fixtures/buckets' | ||
import { createDirectory } from '../fixtures/files' | ||
import { afterTest, beforeTest } from '../fixtures/beforeTest' | ||
import { fillTextInputByName } from '../fixtures/textInput' | ||
import { openCmdkMenu } from '../fixtures/cmdk' | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await beforeTest(page, { | ||
hostdCount: 3, | ||
}) | ||
}) | ||
|
||
test.afterEach(async () => { | ||
await afterTest() | ||
}) | ||
|
||
test('can search for a file within a bucket via the actions menu', async ({ | ||
page, | ||
}) => { | ||
test.setTimeout(80_000) | ||
await navigateToBuckets({ page }) | ||
await createBucket(page, 'bucket-1') | ||
await openBucket(page, 'bucket-1') | ||
await createDirectory(page, 'foobar-1') | ||
await createDirectory(page, 'foobar-2') | ||
await navigateToBuckets({ page }) | ||
await createBucket(page, 'bucket-2') | ||
await openBucket(page, 'bucket-2') | ||
await createDirectory(page, 'foobar-1') | ||
await createDirectory(page, 'foobar-2') | ||
await page.getByLabel('search files').click() | ||
const dialog = page.getByRole('dialog') | ||
await expect(dialog.locator('div[cmdk-item]')).toHaveCount(2) | ||
await expect(dialog.getByText('bucket-2')).toBeVisible() | ||
await expect( | ||
dialog.locator('div[cmdk-item]').getByText('foobar-1') | ||
).toBeVisible() | ||
await expect( | ||
dialog.locator('div[cmdk-item]').getByText('foobar-2') | ||
).toBeVisible() | ||
await fillTextInputByName(page, 'search files', 'foobar-1') | ||
await expect(dialog.locator('div[cmdk-item]')).toHaveCount(1) | ||
await expect( | ||
dialog.locator('div[cmdk-item]').getByText('foobar-1') | ||
).toBeVisible() | ||
}) | ||
|
||
test('can search for a file within a bucket via the cmdk menu', async ({ | ||
page, | ||
}) => { | ||
test.setTimeout(80_000) | ||
await navigateToBuckets({ page }) | ||
await createBucket(page, 'bucket-1') | ||
await openBucket(page, 'bucket-1') | ||
await createDirectory(page, 'foobar-1') | ||
await createDirectory(page, 'foobar-2') | ||
await navigateToBuckets({ page }) | ||
await createBucket(page, 'bucket-2') | ||
await openBucket(page, 'bucket-2') | ||
await createDirectory(page, 'foobar-1') | ||
await createDirectory(page, 'foobar-2') | ||
await page.getByLabel('search files').click() | ||
const dialog = await openCmdkMenu(page) | ||
await fillTextInputByName(page, 'cmdk-input', 'search files in bucket') | ||
await expect(dialog.locator('div[cmdk-item]')).toHaveCount(1) | ||
await dialog | ||
.locator('div[cmdk-item]') | ||
.getByText('search files in bucket') | ||
.click() | ||
await expect(dialog.locator('div[cmdk-item]')).toHaveCount(2) | ||
await expect(dialog.getByText('bucket-2')).toBeVisible() | ||
await expect( | ||
dialog.locator('div[cmdk-item]').getByText('foobar-1') | ||
).toBeVisible() | ||
await expect( | ||
dialog.locator('div[cmdk-item]').getByText('foobar-2') | ||
).toBeVisible() | ||
await fillTextInputByName(page, 'cmdk-input', 'foobar-1') | ||
await expect(dialog.locator('div[cmdk-item]')).toHaveCount(1) | ||
await expect( | ||
dialog.locator('div[cmdk-item]').getByText('foobar-1') | ||
).toBeVisible() | ||
}) | ||
|
||
test('can search for a file across all buckets', async ({ page }) => { | ||
test.setTimeout(80_000) | ||
await navigateToBuckets({ page }) | ||
await createBucket(page, 'bucket-1') | ||
await openBucket(page, 'bucket-1') | ||
await createDirectory(page, 'foobar-1') | ||
await createDirectory(page, 'foobar-2') | ||
await navigateToBuckets({ page }) | ||
await createBucket(page, 'bucket-2') | ||
await openBucket(page, 'bucket-2') | ||
await createDirectory(page, 'foobar-1') | ||
await createDirectory(page, 'foobar-2') | ||
await page.focus('body') | ||
const dialog = await openCmdkMenu(page) | ||
await fillTextInputByName(page, 'cmdk-input', 'search all files') | ||
await expect(dialog.locator('div[cmdk-item]')).toHaveCount(1) | ||
await dialog.locator('div[cmdk-item]').getByText('search all files').click() | ||
await expect( | ||
dialog.locator('div[cmdk-item]').getByText('bucket-1') | ||
).toHaveCount(2) | ||
await expect( | ||
dialog.locator('div[cmdk-item]').getByText('bucket-2') | ||
).toHaveCount(2) | ||
await expect( | ||
dialog.locator('div[cmdk-item]').getByText('foobar-1') | ||
).toHaveCount(2) | ||
await expect( | ||
dialog.locator('div[cmdk-item]').getByText('foobar-2') | ||
).toHaveCount(2) | ||
await fillTextInputByName(page, 'cmdk-input', 'foobar-1') | ||
await expect(dialog.locator('div[cmdk-item]')).toHaveCount(2) | ||
await expect( | ||
dialog.locator('div[cmdk-item]').getByText('foobar-1') | ||
).toHaveCount(2) | ||
await expect( | ||
dialog.locator('div[cmdk-item]').getByText('foobar-2') | ||
).toHaveCount(0) | ||
}) |
Oops, something went wrong.