Skip to content

Commit 2fc9807

Browse files
committed
service banner
1 parent c51903a commit 2fc9807

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

site/e2e/tests/deployment/appearance.spec.ts

+25-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { chromium, expect, test } from "@playwright/test";
2+
import { expectUrl } from "../../expectUrl";
23
import { randomName, requiresEnterpriseLicense } from "../../helpers";
34

45
test("set application name", async ({ page }) => {
@@ -22,9 +23,9 @@ test("set application name", async ({ page }) => {
2223
const incognitoPage = await incognitoContext.newPage();
2324
await incognitoPage.goto("/", { waitUntil: "domcontentloaded" });
2425

25-
// Verify banner
26-
const banner = incognitoPage.locator("h1", { hasText: applicationName });
27-
await expect(banner).toBeVisible();
26+
// Verify the application name
27+
const name = incognitoPage.locator("h1", { hasText: applicationName });
28+
await expect(name).toBeVisible();
2829

2930
// Shut down browser
3031
await incognitoPage.close();
@@ -58,3 +59,24 @@ test("set application logo", async ({ page }) => {
5859
await incognitoPage.close();
5960
await browser.close();
6061
});
62+
63+
test("set service banner", async ({ page }) => {
64+
requiresEnterpriseLicense();
65+
66+
await page.goto("/deployment/appearance", { waitUntil: "domcontentloaded" });
67+
68+
const message = "Mary has a little lamb.";
69+
70+
// Fill out the form
71+
const form = page.locator("form", { hasText: "Service Banner" });
72+
await form.getByLabel("Enabled", { exact: true }).check();
73+
await form.getByLabel("Message", { exact: true }).fill(message);
74+
await form.getByRole("button", { name: "Submit" }).click();
75+
76+
// Verify service banner
77+
await page.goto("/workspaces", { waitUntil: "domcontentloaded" });
78+
await expectUrl(page).toHavePathName("/workspaces");
79+
80+
const bar = page.locator("div.service-banner", { hasText: message });
81+
await expect(bar).toBeVisible();
82+
});

site/src/modules/dashboard/ServiceBanner/ServiceBannerView.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const ServiceBannerView: FC<ServiceBannerViewProps> = ({
1616
isPreview,
1717
}) => {
1818
return (
19-
<div css={[styles.banner, { backgroundColor }]}>
19+
<div css={[styles.banner, { backgroundColor }]} className="service-banner">
2020
{isPreview && <Pill type="info">Preview</Pill>}
2121
<div
2222
css={[

0 commit comments

Comments
 (0)