Skip to content

Commit

Permalink
fix: dashboard test
Browse files Browse the repository at this point in the history
  • Loading branch information
CurryYangxx committed Jan 23, 2025
1 parent 2e66788 commit d7d87ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,22 @@ test.describe('Dashboard', async () => {
await page.getByTestId('project').click();

// Rename document
await page.getByLabel('my-spec.yaml').getByRole('button').click();
await page.getByLabel('Files').getByLabel('my-spec.yaml').getByRole('button').click();
await page.getByRole('menuitem', { name: 'Rename' }).click();
await page.locator('text=Rename DocumentName Rename >> input[type="text"]').fill('test123');
await page.click('#root button:has-text("Rename")');
await expect(page.locator('.app')).toContainText('test123');

// Duplicate document
await page.getByLabel('test123').getByRole('button').click();
await page.getByLabel('Files').getByLabel('test123').getByRole('button').click();
await page.getByRole('menuitem', { name: 'Duplicate' }).click();
await page.locator('input[name="name"]').fill('test123-duplicate');
await page.click('[role="dialog"] button:has-text("Duplicate")');

await page.getByTestId('project').click();

// Delete document
await page.getByLabel('test123-duplicate').getByRole('button').click();
await page.getByLabel('Files').getByLabel('test123-duplicate').getByRole('button').click();
await page.getByRole('menuitem', { name: 'Delete' }).click();
await page.getByRole('button', { name: 'Delete' }).click();
// @TODO: Re-enable - Requires mocking VCS operations
Expand All @@ -141,15 +141,15 @@ test.describe('Dashboard', async () => {
await expect(page.locator('.app')).toContainText('test123');

// Duplicate collection
await page.getByLabel('test123').getByRole('button').click();
await page.getByLabel('Files').getByLabel('test123').getByRole('button').click();
await page.getByRole('menuitem', { name: 'Duplicate' }).click();
await page.locator('input[name="name"]').fill('test123-duplicate');
await page.click('[role="dialog"] button:has-text("Duplicate")');

await page.getByTestId('project').click();

// Delete collection
await page.getByLabel('test123-duplicate').getByRole('button').click();
await page.getByLabel('Files').getByLabel('test123-duplicate').getByRole('button').click();
await page.getByRole('menuitem', { name: 'Delete' }).click();
await page.getByRole('button', { name: 'Delete' }).click();
// @TODO: Re-enable - Requires mocking VCS operations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test.describe('design document operations', async () => {
await page.getByPlaceholder('my-spec.yaml').fill('jurassic park');
await page.getByPlaceholder('my-spec.yaml').press('Enter');
await page.getByTestId('project').click();
await page.getByLabel('jurassic park').click();
await page.getByLabel('Files').getByLabel('jurassic park').click();
});

test('can delete a test suite with confirmation modal', async ({ page }) => {
Expand Down

0 comments on commit d7d87ef

Please sign in to comment.