This commit is contained in:
Michael Telatynski
2025-05-14 13:52:58 +01:00
parent 3c7bb885fd
commit 1a2184d5c8
10 changed files with 16 additions and 7 deletions
+5 -1
View File
@@ -155,6 +155,7 @@ const Menu: FC<Props> = ({ api, config, fallbackLogoUrl }) => {
const [open, setOpen] = useState(false);
let content: JSX.Element;
let logoUrl = fallbackLogoUrl;
if (config instanceof Error) {
content = <CentredContainer>{api.i18n.translate("univention_error")}</CentredContainer>;
} else if (config) {
@@ -165,6 +166,9 @@ const Menu: FC<Props> = ({ api, config, fallbackLogoUrl }) => {
))}
</>
);
if (config.logo_url) {
logoUrl = config.logo_url;
}
} else {
content = (
<CentredContainer>
@@ -205,7 +209,7 @@ const Menu: FC<Props> = ({ api, config, fallbackLogoUrl }) => {
>
<Dialog.Title>
<SidebarHeading>
<Logo api={api} src={config?.logo_url ?? fallbackLogoUrl} />
<Logo api={api} src={logoUrl} />
<Dialog.Close asChild>
<CloseButton
aria-label={api.i18n.translate("close_label")}
@@ -5,15 +5,21 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE files in the repository root for full details.
*/
import { test, expect } from "../../../../playwright/element-web-test.ts";
import { test as base, expect } from "../../../../playwright/element-web-test.ts";
import { ModuleConfig } from "../src/config.ts";
const test = base.extend<{
// Resolver for when to respond to the navigation.json request
navigationJsonResolver: PromiseWithResolvers<void>;
}>({
navigationJsonResolver: async ({}, use) => {
await use(Promise.withResolvers<void>());
},
});
test.describe("Banner", () => {
test.use({
displayName: "Timmy",
navigationJsonResolver: async ({}, use) => {
await use(Promise.withResolvers<void>());
},
page: async ({ context, page, moduleDir }, use) => {
for (const path of ["logo.svg", "app1.png", "app2.png", "opendesk/"]) {
await context.route(`/${path}*`, async (route) => {
@@ -190,14 +196,13 @@ test.describe("Banner", () => {
await expect(page.getByRole("heading", { name: "Welcome to Element!" })).toBeVisible();
await expect(page.getByLabel("Show portal")).toHaveAttribute("href", "https://example.com/portal");
const nav = page.locator("nav");
const trigger = page.getByLabel("Show menu");
await trigger.click();
const sidebar = page.getByRole("dialog");
await expect(sidebar.getByText("Failed to load")).toBeVisible();
await expect(sidebar).toMatchScreenshot("univention_error.png");
await expect(axe).toHaveNoViolations();
});
});
});
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB