Open History to see the last commit
1import { describe, expect, it } from "vitest";
2
3import {
4 BRAND_ASSET_PATHS,
5 DEVELOPMENT_ICON_OVERRIDES,
6 PUBLISH_ICON_OVERRIDES,
7 resolveWebAssetBrandForChannel,
8 resolveWebIconOverrides,
9} from "./brand-assets.ts";
10
11describe("brand-assets", () => {
12 it("maps server publish web assets to production icons", () => {
13 expect(PUBLISH_ICON_OVERRIDES).toEqual([
14 {
15 sourceRelativePath: BRAND_ASSET_PATHS.productionWebFaviconIco,
16 targetRelativePath: "dist/client/favicon.ico",
17 },
18 {
19 sourceRelativePath: BRAND_ASSET_PATHS.productionWebFavicon16Png,
20 targetRelativePath: "dist/client/favicon-16x16.png",
21 },
22 {
23 sourceRelativePath: BRAND_ASSET_PATHS.productionWebFavicon32Png,
24 targetRelativePath: "dist/client/favicon-32x32.png",
25 },
26 {
27 sourceRelativePath: BRAND_ASSET_PATHS.productionWebAppleTouchIconPng,
28 targetRelativePath: "dist/client/apple-touch-icon.png",
29 },
30 ]);
31 });
32
33 it("maps server build web assets to development icons", () => {
34 expect(DEVELOPMENT_ICON_OVERRIDES[0]).toEqual({
35 sourceRelativePath: BRAND_ASSET_PATHS.developmentWebFaviconIco,
36 targetRelativePath: "dist/client/favicon.ico",
37 });
38 });
39
40 it("can target hosted web dist directly", () => {
41 expect(resolveWebIconOverrides("production", "apps/web/dist")).toContainEqual({
42 sourceRelativePath: BRAND_ASSET_PATHS.productionWebAppleTouchIconPng,
43 targetRelativePath: "apps/web/dist/apple-touch-icon.png",
44 });
45 });
46
47 it("maps hosted nightly web assets to nightly icons", () => {
48 expect(resolveWebIconOverrides("nightly", "apps/web/dist")).toContainEqual({
49 sourceRelativePath: BRAND_ASSET_PATHS.nightlyWebFaviconIco,
50 targetRelativePath: "apps/web/dist/favicon.ico",
51 });
52 });
53
54 it("maps hosted release channels to web asset brands", () => {
55 expect(resolveWebAssetBrandForChannel("latest")).toBe("production");
56 expect(resolveWebAssetBrandForChannel("nightly")).toBe("nightly");
57 });
58});