fix: prevent infinite re-render loop from issue retry callbacks (#2550)
This commit is contained in:
committed by
dermotduffy
parent
c3d3dd3934
commit
3fe5e4004a
@@ -28,6 +28,7 @@ import {
|
||||
createHASS,
|
||||
createMockTemplateRenderer,
|
||||
createView,
|
||||
stubConnectedHomeAssistant,
|
||||
} from '../../test-utils';
|
||||
|
||||
const createAPI = (): CardController => {
|
||||
@@ -38,6 +39,7 @@ const createAPI = (): CardController => {
|
||||
return api;
|
||||
};
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('ActionsManager', () => {
|
||||
describe('getMergedActions', () => {
|
||||
const config = {
|
||||
@@ -176,8 +178,13 @@ describe('ActionsManager', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// @vitest-environment jsdom
|
||||
describe('handleInteractionEvent', () => {
|
||||
// Templated actions render through ha-nunjucks, which polls (via setTimeout)
|
||||
// for a connected `home-assistant` element until ready. Stubbing one makes
|
||||
// it resolve synchronously, so no retry timer leaks past test teardown.
|
||||
beforeAll(() => {
|
||||
stubConnectedHomeAssistant();
|
||||
});
|
||||
beforeEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user