Files
t3code/scripts/lib/brand-assets.test.ts

46 lines
1.5 KiB
TypeScript

import { describe, expect, it } from "vitest";
import {
BRAND_ASSET_PATHS,
DEVELOPMENT_ICON_OVERRIDES,
PUBLISH_ICON_OVERRIDES,
resolveWebIconOverrides,
} from "./brand-assets.ts";
describe("brand-assets", () => {
it("maps server publish web assets to production icons", () => {
expect(PUBLISH_ICON_OVERRIDES).toEqual([
{
sourceRelativePath: BRAND_ASSET_PATHS.productionWebFaviconIco,
targetRelativePath: "dist/client/favicon.ico",
},
{
sourceRelativePath: BRAND_ASSET_PATHS.productionWebFavicon16Png,
targetRelativePath: "dist/client/favicon-16x16.png",
},
{
sourceRelativePath: BRAND_ASSET_PATHS.productionWebFavicon32Png,
targetRelativePath: "dist/client/favicon-32x32.png",
},
{
sourceRelativePath: BRAND_ASSET_PATHS.productionWebAppleTouchIconPng,
targetRelativePath: "dist/client/apple-touch-icon.png",
},
]);
});
it("maps server build web assets to development icons", () => {
expect(DEVELOPMENT_ICON_OVERRIDES[0]).toEqual({
sourceRelativePath: BRAND_ASSET_PATHS.developmentWebFaviconIco,
targetRelativePath: "dist/client/favicon.ico",
});
});
it("can target hosted web dist directly", () => {
expect(resolveWebIconOverrides("production", "apps/web/dist")).toContainEqual({
sourceRelativePath: BRAND_ASSET_PATHS.productionWebAppleTouchIconPng,
targetRelativePath: "apps/web/dist/apple-touch-icon.png",
});
});
});