chore: Update ha-nunjucks to 1.6.2 (#2549)
- Replaces: https://github.com/dermotduffy/advanced-camera-card/pull/2515
This commit is contained in:
committed by
dermotduffy
parent
015fb1876d
commit
c3d3dd3934
@@ -8,8 +8,15 @@ import type {
|
||||
BrowseMediaMetadata,
|
||||
RichBrowseMedia,
|
||||
} from '../../../../src/ha/browse-media/types';
|
||||
import { createHASS, createMockTemplateRenderer } from '../../../test-utils';
|
||||
import {
|
||||
createHASS,
|
||||
createMockTemplateRenderer,
|
||||
stubConnectedHomeAssistant,
|
||||
} from '../../../test-utils';
|
||||
|
||||
// The `with template matcher` test loads the real ha-nunjucks engine, which
|
||||
// reads `window`/`document` at import, so this suite needs a DOM environment.
|
||||
// @vitest-environment jsdom
|
||||
describe('MediaMatcher', () => {
|
||||
// A mock renderer for the matcher plumbing, which never renders templates.
|
||||
// The `value_template` suite below uses its own real, loaded engine.
|
||||
@@ -153,6 +160,7 @@ describe('MediaMatcher', () => {
|
||||
// renderer (rather than the shared mock).
|
||||
const templateManager = new TemplateManager();
|
||||
beforeAll(async () => {
|
||||
stubConnectedHomeAssistant();
|
||||
await templateManager.loadRenderer();
|
||||
});
|
||||
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import { beforeAll, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { TemplateManager } from '../../../src/card-controller/templates/index';
|
||||
import { createConfig, createHASS, createStateEntity } from '../../test-utils';
|
||||
import {
|
||||
createConfig,
|
||||
createHASS,
|
||||
createStateEntity,
|
||||
stubConnectedHomeAssistant,
|
||||
} from '../../test-utils';
|
||||
|
||||
// ha-nunjucks reads `window`/`document` at import and renders via a
|
||||
// `window.haNunjucks` global, so the renderer needs a DOM environment.
|
||||
// @vitest-environment jsdom
|
||||
describe('TemplateManager', () => {
|
||||
beforeAll(() => stubConnectedHomeAssistant());
|
||||
|
||||
describe('loadRenderer', () => {
|
||||
it('should render a template raw before the engine is loaded', () => {
|
||||
const manager = new TemplateManager();
|
||||
|
||||
Reference in New Issue
Block a user