mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 02:49:51 +00:00
* Add rspack * Remove TransformAsyncModulesPlugin from rspack * Migrate all webpack usage to rspack * Migrate tests to vitest * Fix test suites * Remove chai dependency * Fix compute_state_display tests * Fix resolveTimeZone * Reduces test pipeline * Revert test ci * optimize chunk filtering * Migrate landing-page to rspack * Update rspack dependencies * Add rsdoctor * Fix prod build bundle size * Use rsdoctor for demo stats * Remove unused webpack configs * Update build-scripts/rspack.cjs Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com> * Fix eslint * Update rspack * Remove unused code --------- Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
import { assert, describe, it } from "vitest";
|
|
import { brandsUrl } from "../../src/util/brands-url";
|
|
|
|
describe("Generate brands Url", () => {
|
|
it("Generate logo brands url for cloud component without fallback", () => {
|
|
assert.strictEqual(
|
|
// @ts-ignore
|
|
brandsUrl({ domain: "cloud", type: "logo" }),
|
|
"https://brands.home-assistant.io/cloud/logo.png"
|
|
);
|
|
});
|
|
it("Generate icon brands url for cloud component without fallback", () => {
|
|
assert.strictEqual(
|
|
// @ts-ignore
|
|
brandsUrl({ domain: "cloud", type: "icon" }),
|
|
"https://brands.home-assistant.io/cloud/icon.png"
|
|
);
|
|
});
|
|
it("Generate logo brands url for cloud component with fallback", () => {
|
|
assert.strictEqual(
|
|
// @ts-ignore
|
|
brandsUrl({ domain: "cloud", type: "logo", useFallback: true }),
|
|
"https://brands.home-assistant.io/_/cloud/logo.png"
|
|
);
|
|
});
|
|
it("Generate icon brands url for cloud component with fallback", () => {
|
|
assert.strictEqual(
|
|
// @ts-ignore
|
|
brandsUrl({ domain: "cloud", type: "icon", useFallback: true }),
|
|
"https://brands.home-assistant.io/_/cloud/icon.png"
|
|
);
|
|
});
|
|
|
|
it("Generate dark theme optimized logo brands url for cloud component without fallback", () => {
|
|
assert.strictEqual(
|
|
// @ts-ignore
|
|
brandsUrl({ domain: "cloud", type: "logo", darkOptimized: true }),
|
|
"https://brands.home-assistant.io/cloud/dark_logo.png"
|
|
);
|
|
});
|
|
});
|