Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions apps/desktop/e2e/workhub-layout.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { expect, test, COMPOSER_INPUT } from './fixtures';

test('WorkHub target metadata does not overlap the submitted Session result', async ({
window: page,
}) => {
const composer = page.locator(COMPOSER_INPUT);
await composer.fill('支付回调幂等性');
await composer.press('Enter');
await expect(page.getByRole('button', { name: '重新生成' })).toHaveCount(1, {
timeout: 20_000,
});

const sessionName = await page.evaluate(async () =>
(await window.maka.sessions.list())[0]?.name,
);
expect(sessionName).toBeTruthy();
await page.evaluate(async () => {
await window.maka.settings.updateClient({ workHub: { enabled: true } });
});
await expect(page.getByRole('main', { name: 'WorkHub' })).toBeVisible();

const workHubComposer = page.locator(
'.workhub-surface .maka-composer-editor [contenteditable="true"]',
);
await workHubComposer.fill(`继续${sessionName},补充重复投递测试点。`);
await workHubComposer.press('Enter');
await expect(page.locator('.workhub-result')).toBeVisible();

const geometry = await page.evaluate(() => {
const button = document.querySelector<HTMLElement>('.workhub-submitted > button')!;
const project = button.querySelector<HTMLElement>('.workhub-submitted-session small')!;
const result = document.querySelector<HTMLElement>('.workhub-result')!;
const buttonBox = button.getBoundingClientRect();
const projectBox = project.getBoundingClientRect();
const resultBox = result.getBoundingClientRect();
return {
buttonContainsProject: buttonBox.bottom >= projectBox.bottom,
overlapHeight:
Math.min(projectBox.bottom, resultBox.bottom) - Math.max(projectBox.top, resultBox.top),
};
});

expect(geometry.buttonContainsProject).toBe(true);
expect(geometry.overlapHeight).toBeLessThanOrEqual(0);
});
1 change: 1 addition & 0 deletions apps/desktop/src/renderer/styles/workhub.css
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
align-items: flex-start;
justify-content: space-between;
width: 100%;
height: auto;
padding: 10px 0;
gap: 16px;
border: 0;
Expand Down
2 changes: 1 addition & 1 deletion docs/astryx-surface-file-inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Each row is one on-disk product surface file. Regenerated inventory must stay in

Wiki bar: Design Conventions · API Use-the-System · Theming · Container Padding.

**Totals:** 204 files — blocker 0, polish 0, aligned 204.
**Totals:** 206 files — blocker 0, polish 0, aligned 206.

## Exclusions (explicit)

Expand Down