mirror of
https://github.com/enso-org/enso.git
synced 2024-12-22 14:51:33 +03:00
b5641aa3bd
- Fix React DevTools not working in Firefox - Fix selection of asset names when editing them, not working at all in Firefox - Convert tick/cross buttons when editing assets, and the "plus" and "reload" buttons on the "shared with" column, "labels" column, and keyboard shortcuts table, to match more with the rest of the design - Update clip path when the container resizes, so that the icons for hidden columns never overlap the actual table header - Fix #10184 - Fix renames being committed even when cancelling - Fix duplicate name detection - previously, all asset types only checked folders with the same name, not assets with the same name - I'm not 100% sure this is the correct behavior still - Stop using `kbd` (`aria.Keyboard`) to display keyboard shortcuts, since they should not be displayed in a monospace font. - Fix "plus" and "reload" buttons going past the right side of their parent table cell - Limit length of `PermissionDisplay` - if the username of a user with permission is too long, it uses a tooltip instead - Update the username dynamically for all permissions owned by self, when changing username in the settings. - This avoids having to fully invalidate the directory tree every time the username changes, given that nothing changes about the assets' metadata themselves. - Cache children in the Drive tree - This avoids loading spinners when closing a folder and immediately reopening it. - Note that children are still re-fetched on reopen to ensure freshness # Important Notes - This MAY be split into multiple smaller PRs. However, I think it's better to QA as a single PR, to avoid duplicating work checking behavior that may be changed by a sibling PR (assuming the PR was split into multiple).
61 lines
2.7 KiB
TypeScript
61 lines
2.7 KiB
TypeScript
/** @file Test dragging of labels. */
|
|
import * as test from '@playwright/test'
|
|
|
|
import * as backend from '#/services/Backend'
|
|
|
|
import * as actions from './actions'
|
|
|
|
test.test('drag labels onto single row', async ({ page }) => {
|
|
const { api } = await actions.mockAllAndLogin({ page })
|
|
const assetRows = actions.locateAssetRows(page)
|
|
const labels = actions.locateLabelsPanelLabels(page)
|
|
const label = 'aaaa'
|
|
api.addLabel(label, backend.COLORS[0])
|
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
api.addLabel('bbbb', backend.COLORS[1]!)
|
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
api.addLabel('cccc', backend.COLORS[2]!)
|
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
api.addLabel('dddd', backend.COLORS[3]!)
|
|
api.addDirectory('foo')
|
|
api.addSecret('bar')
|
|
api.addFile('baz')
|
|
api.addSecret('quux')
|
|
await actions.login({ page })
|
|
|
|
await labels.nth(0).dragTo(assetRows.nth(1))
|
|
await test.expect(actions.locateAssetLabels(assetRows.nth(0)).getByText(label)).not.toBeVisible()
|
|
await test.expect(actions.locateAssetLabels(assetRows.nth(1)).getByText(label)).toBeVisible()
|
|
await test.expect(actions.locateAssetLabels(assetRows.nth(2)).getByText(label)).not.toBeVisible()
|
|
await test.expect(actions.locateAssetLabels(assetRows.nth(3)).getByText(label)).not.toBeVisible()
|
|
})
|
|
|
|
test.test('drag labels onto multiple rows', async ({ page }) => {
|
|
const { api } = await actions.mockAllAndLogin({ page })
|
|
const assetRows = actions.locateAssetRows(page)
|
|
const labels = actions.locateLabelsPanelLabels(page)
|
|
const label = 'aaaa'
|
|
api.addLabel(label, backend.COLORS[0])
|
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
api.addLabel('bbbb', backend.COLORS[1]!)
|
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
api.addLabel('cccc', backend.COLORS[2]!)
|
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
api.addLabel('dddd', backend.COLORS[3]!)
|
|
api.addDirectory('foo')
|
|
api.addSecret('bar')
|
|
api.addFile('baz')
|
|
api.addSecret('quux')
|
|
await actions.login({ page })
|
|
|
|
await page.keyboard.down(await actions.modModifier(page))
|
|
await actions.clickAssetRow(assetRows.nth(0))
|
|
await actions.clickAssetRow(assetRows.nth(2))
|
|
await labels.nth(0).dragTo(assetRows.nth(2))
|
|
await page.keyboard.up(await actions.modModifier(page))
|
|
await test.expect(actions.locateAssetLabels(assetRows.nth(0)).getByText(label)).toBeVisible()
|
|
await test.expect(actions.locateAssetLabels(assetRows.nth(1)).getByText(label)).not.toBeVisible()
|
|
await test.expect(actions.locateAssetLabels(assetRows.nth(2)).getByText(label)).toBeVisible()
|
|
await test.expect(actions.locateAssetLabels(assetRows.nth(3)).getByText(label)).not.toBeVisible()
|
|
})
|