@@ -0,0 +1,27 @@
|
||||
// SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0
|
||||
// The tab icon is the ConusAI mark, the file @conusai-kit/brand ships. Not a copy: the web build emits the kit's bytes
|
||||
// at /favicon.png, and the document head points there.
|
||||
|
||||
import { existsSync, readFileSync } from "node:fs"
|
||||
import { createRequire } from "node:module"
|
||||
import { appBrand } from "@app/config"
|
||||
import { describe, expect, it } from "vitest"
|
||||
|
||||
const web = new URL("../apps/web/", import.meta.url)
|
||||
|
||||
describe("the favicon", () => {
|
||||
it("is the path the build emits", () => {
|
||||
expect(appBrand.logo.favicon).toBe("/favicon.png")
|
||||
})
|
||||
|
||||
it("is emitted from the kit's file, and the template holds no icon of its own", () => {
|
||||
const config = readFileSync(new URL("vite.config.ts", web), "utf8")
|
||||
expect(config).toContain(`"@conusai-kit/brand/logo/favicon.png"`)
|
||||
expect(existsSync(new URL("public/favicon.svg", web))).toBe(false)
|
||||
})
|
||||
|
||||
it("resolves to a PNG in the kit", () => {
|
||||
const file = createRequire(new URL("package.json", web)).resolve("@conusai-kit/brand/logo/favicon.png")
|
||||
expect(readFileSync(file).subarray(1, 4).toString()).toBe("PNG")
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user