Files
coder/site/e2e/tests/deployment/appearance.spec.ts
T
blink-so[bot] 5119db3cd2 feat: underline links in announcement banner for better visibility (#20166)
## Overview

Links in announcement banners are now underlined to make them visually
distinguishable without requiring users to hover over them.

Context:
[Slack](https://codercom.slack.com/archives/C0989BZU23T/p1759503061267819)

## Changes

- Added `text-decoration: underline` to links in the announcement banner
component

---------

Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com>
Co-authored-by: blink-so[bot] <157993532+blink-so[bot]@users.noreply.github.com>
Co-authored-by: Michael Smith <michaelsmith@coder.com>
2025-10-16 15:24:45 -04:00

90 lines
2.9 KiB
TypeScript

import { chromium, expect, test } from "@playwright/test";
import { expectUrl } from "../../expectUrl";
import { login, randomName, requiresLicense } from "../../helpers";
import { beforeCoderTest } from "../../hooks";
test.beforeEach(async ({ page }) => {
beforeCoderTest(page);
await login(page);
});
test("set application name", async ({ page }) => {
requiresLicense();
await page.goto("/deployment/appearance", { waitUntil: "domcontentloaded" });
const applicationName = randomName();
// Fill out the form
const form = page.locator("form", { hasText: "Application name" });
await form
.getByLabel("Application name", { exact: true })
.fill(applicationName);
await form.getByRole("button", { name: "Submit" }).click();
// Open a new session without cookies to see the login page
const browser = await chromium.launch();
const incognitoContext = await browser.newContext();
await incognitoContext.clearCookies();
const incognitoPage = await incognitoContext.newPage();
await incognitoPage.goto("/", { waitUntil: "domcontentloaded" });
// Verify the application name
const name = incognitoPage.locator("h1", { hasText: applicationName });
await expect(name).toBeVisible();
// Shut down browser
await incognitoPage.close();
await browser.close();
});
test("set application logo", async ({ page }) => {
requiresLicense();
await page.goto("/deployment/appearance", { waitUntil: "domcontentloaded" });
const imageLink = "/icon/azure.png";
// Fill out the form
const form = page.locator("form", { hasText: "Logo URL" });
await form.getByLabel("Logo URL", { exact: true }).fill(imageLink);
await form.getByRole("button", { name: "Submit" }).click();
// Open a new session without cookies to see the login page
const browser = await chromium.launch();
const incognitoContext = await browser.newContext();
await incognitoContext.clearCookies();
const incognitoPage = await incognitoContext.newPage();
await incognitoPage.goto("/", { waitUntil: "domcontentloaded" });
// Verify banner
const logo = incognitoPage.locator("img.application-logo");
await expect(logo).toHaveAttribute("src", imageLink);
// Shut down browser
await incognitoPage.close();
await browser.close();
});
test("set service banner", async ({ page }) => {
requiresLicense();
await page.goto("/deployment/appearance", { waitUntil: "domcontentloaded" });
const message = "Mary has a little lamb.";
// Fill out the form
await page.getByRole("button", { name: "New" }).click();
const form = page.getByRole("presentation");
await form.getByLabel("Message", { exact: true }).fill(message);
await form.getByRole("button", { name: "Update" }).click();
// Verify service banner
await page.goto("/workspaces", { waitUntil: "domcontentloaded" });
await expectUrl(page).toHavePathName("/workspaces");
const banner = page.getByTestId("service-banner");
await expect(banner).toBeVisible();
await expect(banner).toHaveText(message);
});