Files
forge/web_src/js/modules/favicon-status.test.ts
zeekayandHanzo Dev 3ea73962ff rebrand: complete white-label leak sweep of Hanzo-served surfaces
Finishes the residual pass: the bulk of served leaks remained (28 locale
files, most templates, all raster/source assets, Chinese READMEs). Imports,
identifiers, and wire contracts are left intact.

- locale: 28 files, all "Gitea" -> "Hanzo Git"; docs/blog/about.gitea.* +
  gitea.com/.io + go-gitea help URLs -> docs.hanzo.ai / git.hanzo.ai /
  github.com/hanzoai/git (keys with lowercase "gitea" preserved)
- templates: footer, swagger UI title + generated OpenAPI specs (stale
  gitea.dev x-go-package -> github.com/hanzoai/git), webhook usernames,
  OAuth-source labels, package/help doc links, example org/team identifiers
- Go served defaults: RSS feed author/description, git commit user.name +
  fallback email, WWW-Authenticate realms (OAuth2/packages/container),
  500/error pages, MS Teams card, built-in OAuth provider label, CLI --help,
  SSH + push-rejection messages, startup/index/redis/doctor logs, test-mail
  subject + X-Mailer
- config: app.example.ini APP_NAME default
- assets: source assets/*.svg, gitea.svg, gitea-gitea sprite, and all PNGs
  (logo/favicon/apple-touch/avatar_default) regenerated as the committed
  black-tile Hanzo mark; --color-logo #609926 -> monochrome; favicon-status
  test realigned to the new mark (viewBox 64)
- README.zh-tw + README.zh-cn rewritten as Hanzo Git
- render field CommitParticipant.GiteaUser -> User

Preserved (imports / identifiers / external contracts): code.gitea.io,
module github.com/hanzoai/git, gitea.dev/sdk dep, X-Gitea-* webhook + email
headers, WWW-Authenticate realm="Gitea" in git-HTTP (Git Credential Manager
OAuth2 detection), GitServiceType "Gitea" migration-source name, theme id
gitea-auto, .gitea-* classes / svg symbol ids, Go/JS identifiers, "The Gitea
Authors" copyright headers, outbound User-Agent headers.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-22 17:44:02 -07:00

30 lines
1.2 KiB
TypeScript

import {buildStatusFaviconSvg, resetActionFavicon, syncActionRunFavicon} from './favicon-status.ts';
test('buildStatusFaviconSvg uses action status icons', () => {
const success = buildStatusFaviconSvg('success');
expect(success).toContain('viewBox="0 0 64 64"');
expect(success).toContain('#000000');
expect(success).toContain('data-actions-status-name="success"');
const running = buildStatusFaviconSvg('running');
expect(running).toContain('data-actions-status-name="running"');
const failure = buildStatusFaviconSvg('failure');
expect(failure).toContain('data-actions-status-name="failure"');
});
test('syncActionRunFavicon updates favicon links', () => {
document.head.innerHTML = `
<link rel="icon" href="/assets/img/favicon.svg" type="image/svg+xml">
<link rel="alternate icon" href="/assets/img/favicon.png" type="image/png">
`;
const links = Array.from(document.querySelectorAll<HTMLLinkElement>('link[rel~="icon"]'));
syncActionRunFavicon('running');
for (const link of links) {
expect(link.href).toMatch(/^data:image\/svg\+xml,/);
expect(decodeURIComponent(link.href)).toContain('data-actions-status-name="running"');
}
resetActionFavicon();
expect(links[0].href).toContain('favicon.svg');
});