fix: prevent infinite re-render loop from issue retry callbacks (#2550)

This commit is contained in:
Dermot Duffy
2026-06-30 17:45:13 -07:00
committed by dermotduffy
parent c3d3dd3934
commit 3fe5e4004a
7 changed files with 137 additions and 99 deletions
@@ -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();
});