webRemoteControlBrand.test.ts 728 B

1234567891011121314151617
  1. import { createElement } from "react";
  2. import { renderToStaticMarkup } from "react-dom/server";
  3. import { describe, expect, it } from "vitest";
  4. import { WebRemoteControlBrand } from "#src/web-remote-control/views.js";
  5. describe("远控页头品牌", () => {
  6. it("品牌图标为装饰性,整体不可交互", () => {
  7. const html = renderToStaticMarkup(createElement(WebRemoteControlBrand));
  8. expect(html).toMatch(/<img[^>]*data-app-logo="zcode"/);
  9. expect(html).toMatch(/<img[^>]*alt=""/);
  10. expect(html).toMatch(/<img[^>]*aria-hidden="true"/);
  11. expect(html).toContain("ZCode");
  12. expect(html).not.toContain("<a ");
  13. expect(html).not.toContain("<button");
  14. expect(html).not.toContain("role=");
  15. });
  16. });