2024-01-31 14:35:41 +03:00
|
|
|
/** @file Tests for the asset panel. */
|
|
|
|
import * as test from '@playwright/test'
|
|
|
|
|
|
|
|
import * as backend from '#/services/Backend'
|
|
|
|
|
|
|
|
import * as permissions from '#/utilities/permissions'
|
|
|
|
|
|
|
|
import * as actions from './actions'
|
|
|
|
|
|
|
|
test.test('open and close asset panel', async ({ page }) => {
|
|
|
|
await actions.mockAllAndLogin({ page })
|
|
|
|
const assetRows = actions.locateAssetRows(page)
|
|
|
|
|
|
|
|
await actions.locateNewFolderIcon(page).click()
|
Refactor CSS; address some design issues (#9260)
- Implement https://github.com/enso-org/cloud-v2/issues/924
- Refactor all numbers out to CSS variables
- Implement some issues raised in the design meeting
- The columns selector now only contains *hidden* columns, rather than all of them.
- Unified opacity for active (100%), selectable and hovered (75%), selectable (50%) and disabled (30%)
- Easily configurable if we want to change it in the future, so the specific values don't matter too much for now.
- Always show asset right panel if it is enabled - display placeholder text if <1 or >1 asset is selected
- Hide docs icon that was in the top right assets menubar (next to the gear icon for asset settings) (as backend functionality has yet to be implemented)
- Clicking a user in the "Shared with" column now adds them to the search as `owner:<username>`
- Add a gap between adjacent rows. This makes each row more visually distinct when many rows are selected
- Center the left column (the first column) of the context menu below the mouse, rather than centering the entire context menu.
- Fix regressions caused by CSS refactor
- Make keyboard selection indicator for asset rows rounded again
- Other misc. fixes and improvements
- Slightly modified styling of chat reaction bar
- Hide the row containing the "New Project" button in the cloud drive, when not in the "Home" drive tab
- Animate rotation of column sort arrow when clicking on a column to change the sort order
- Consistent duration of arrow rotation animation for folder arrows, column sort arrows, chat thread list arrows
- Consistent icon for sort arrow for folders and the chat thread list
- Minor adjustment of styles for optional properties in the Data Link input
Not included in this PR:
- Custom (HTML) scrollbars for consistency across all browsers and all OSes (except perhaps touchscreens)
- Potentially time-consuming to look for a library (and not quite trivial to implement ourselves)
- Columns sliding left as they expand and right as they collapse
- Also non-trivial, especially when taking into account horizontal scrolling.
- Fixing styles to closer resemble Figma design
- As (kinda) mentioned in the meeting - ideally it should be pixel perfect, *but* value consistency with other spacings, opacities etc. over being 100% pixel-perfect
- However, it has *partly* been done - mostly for the home page. It's entirely possible that changes made afterwards broke the spacing again though.
# Important Notes
None
2024-03-13 13:32:05 +03:00
|
|
|
await actions.clickAssetRow(assetRows.nth(0))
|
2024-01-31 14:35:41 +03:00
|
|
|
await test.expect(actions.locateAssetPanel(page)).not.toBeVisible()
|
|
|
|
await actions.locateAssetPanelIcon(page).click()
|
|
|
|
await test.expect(actions.locateAssetPanel(page)).toBeVisible()
|
|
|
|
await actions.locateAssetPanelIcon(page).click()
|
|
|
|
await test.expect(actions.locateAssetPanel(page)).not.toBeVisible()
|
|
|
|
})
|
|
|
|
|
|
|
|
test.test('asset panel contents', async ({ page }) => {
|
|
|
|
const { api } = await actions.mockAll({ page })
|
|
|
|
const { defaultOrganizationId } = api
|
|
|
|
const assetRows = actions.locateAssetRows(page)
|
|
|
|
const description = 'foo bar'
|
|
|
|
const username = 'baz quux'
|
|
|
|
const email = 'baz.quux@email.com'
|
|
|
|
api.addProject('project', {
|
|
|
|
description,
|
|
|
|
permissions: [
|
|
|
|
{
|
|
|
|
permission: permissions.PermissionAction.own,
|
|
|
|
user: {
|
|
|
|
/* eslint-disable @typescript-eslint/naming-convention */
|
2024-03-20 21:01:11 +03:00
|
|
|
pk: defaultOrganizationId,
|
|
|
|
sk: backend.UserId(''),
|
|
|
|
user_subject: backend.Subject(''),
|
2024-01-31 14:35:41 +03:00
|
|
|
user_name: username,
|
|
|
|
user_email: backend.EmailAddress(email),
|
|
|
|
/* eslint-enable @typescript-eslint/naming-convention */
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
})
|
|
|
|
await page.goto('/')
|
|
|
|
await actions.login({ page })
|
|
|
|
|
Refactor CSS; address some design issues (#9260)
- Implement https://github.com/enso-org/cloud-v2/issues/924
- Refactor all numbers out to CSS variables
- Implement some issues raised in the design meeting
- The columns selector now only contains *hidden* columns, rather than all of them.
- Unified opacity for active (100%), selectable and hovered (75%), selectable (50%) and disabled (30%)
- Easily configurable if we want to change it in the future, so the specific values don't matter too much for now.
- Always show asset right panel if it is enabled - display placeholder text if <1 or >1 asset is selected
- Hide docs icon that was in the top right assets menubar (next to the gear icon for asset settings) (as backend functionality has yet to be implemented)
- Clicking a user in the "Shared with" column now adds them to the search as `owner:<username>`
- Add a gap between adjacent rows. This makes each row more visually distinct when many rows are selected
- Center the left column (the first column) of the context menu below the mouse, rather than centering the entire context menu.
- Fix regressions caused by CSS refactor
- Make keyboard selection indicator for asset rows rounded again
- Other misc. fixes and improvements
- Slightly modified styling of chat reaction bar
- Hide the row containing the "New Project" button in the cloud drive, when not in the "Home" drive tab
- Animate rotation of column sort arrow when clicking on a column to change the sort order
- Consistent duration of arrow rotation animation for folder arrows, column sort arrows, chat thread list arrows
- Consistent icon for sort arrow for folders and the chat thread list
- Minor adjustment of styles for optional properties in the Data Link input
Not included in this PR:
- Custom (HTML) scrollbars for consistency across all browsers and all OSes (except perhaps touchscreens)
- Potentially time-consuming to look for a library (and not quite trivial to implement ourselves)
- Columns sliding left as they expand and right as they collapse
- Also non-trivial, especially when taking into account horizontal scrolling.
- Fixing styles to closer resemble Figma design
- As (kinda) mentioned in the meeting - ideally it should be pixel perfect, *but* value consistency with other spacings, opacities etc. over being 100% pixel-perfect
- However, it has *partly* been done - mostly for the home page. It's entirely possible that changes made afterwards broke the spacing again though.
# Important Notes
None
2024-03-13 13:32:05 +03:00
|
|
|
await actions.clickAssetRow(assetRows.nth(0))
|
2024-01-31 14:35:41 +03:00
|
|
|
await actions.locateAssetPanelIcon(page).click()
|
|
|
|
await test.expect(actions.locateAssetPanelDescription(page)).toHaveText(description)
|
|
|
|
// `getByText` is required so that this assertion works if there are multiple permissions.
|
|
|
|
await test.expect(actions.locateAssetPanelPermissions(page).getByText(username)).toBeVisible()
|
|
|
|
})
|