fix: reverse Toolbox header orientation

This commit is contained in:
2026-07-23 01:57:52 +02:00
parent 21283ce25f
commit 803397ff52
16 changed files with 105 additions and 192 deletions

View File

@@ -39,7 +39,7 @@ describe('portal UI', () => {
).toHaveAttribute('rel', 'noopener noreferrer');
expect(
sourceLinks.find((link) =>
link.getAttribute('href')?.endsWith('/toolbox-portal/src/tag/v0.4.1')
link.getAttribute('href')?.endsWith('/toolbox-portal/src/tag/v0.4.2')
)
).toBeDefined();
expect(
@@ -229,16 +229,33 @@ describe('portal UI', () => {
const brand = within(header).getByRole('link', {
name: 'add·ideas Toolbox',
});
const controls = within(header).getByRole('group', {
name: 'Toolbox controls',
});
expect(
personalize.compareDocumentPosition(apps) &
Node.DOCUMENT_POSITION_FOLLOWING
).toBeTruthy();
Array.from(controls.children, (element) =>
element.getAttribute('aria-label')
)
).toEqual(['Help', 'Toolbox source on Gitea', 'Apps', 'Personalize']);
expect(help.compareDocumentPosition(source)).toBe(
Node.DOCUMENT_POSITION_FOLLOWING
);
expect(source.compareDocumentPosition(apps)).toBe(
Node.DOCUMENT_POSITION_FOLLOWING
);
expect(apps.compareDocumentPosition(personalize)).toBe(
Node.DOCUMENT_POSITION_FOLLOWING
);
expect(
apps.compareDocumentPosition(source) & Node.DOCUMENT_POSITION_FOLLOWING
).toBeTruthy();
expect(
source.compareDocumentPosition(help) & Node.DOCUMENT_POSITION_FOLLOWING
).toBeTruthy();
Array.from(
header.querySelector('.toolbox-shell__bar')?.children ?? [],
(element) => element.className
)
).toEqual([
'toolbox-shell__brand',
'toolbox-shell__identity',
'toolbox-shell__controls',
]);
expect(brand.querySelector('img')).toHaveAttribute('src', './favicon.svg');
});
@@ -412,6 +429,13 @@ describe('portal UI', () => {
});
const popover = screen.getByRole('dialog', { name: 'Personalize Toolbox' });
expect(popover).toContainElement(heading);
expect(popover).toContainElement(screen.getByText('On this device'));
expect(
within(popover).getByRole('group', { name: 'Appearance' })
).toBeInTheDocument();
expect(
popover.querySelector('.toolbox-shell__preferences-content')
).toBeInTheDocument();
expect(popover).not.toHaveAttribute('aria-modal');
expect(container.querySelector('.site-shell')).not.toHaveAttribute('inert');
expect(screen.getByText(/does not transmit them/i)).toHaveTextContent(