feat: Add loading spinner on card initialization (#1549)

* feat: Add loading spinner on card initialization

* Minor doc fix.
This commit is contained in:
Dermot Duffy
2024-09-20 19:39:17 -07:00
committed by GitHub
parent 650d99ec00
commit b46ea36265
7 changed files with 139 additions and 28 deletions
@@ -57,6 +57,7 @@ describe('InitializationManager', () => {
it('without hass', async () => {
const manager = new InitializationManager(createCardAPI());
await manager.initializeMandatory();
expect(manager.wasEverInitialized()).toBeFalsy();
});
it('without config', async () => {
@@ -67,6 +68,7 @@ describe('InitializationManager', () => {
vi.mocked(sideLoadHomeAssistantElements).mockResolvedValue(true);
await manager.initializeMandatory();
expect(manager.wasEverInitialized()).toBeFalsy();
});
it('successfully', async () => {
@@ -94,6 +96,8 @@ describe('InitializationManager', () => {
expect(api.getViewManager().initialize).toBeCalled();
expect(api.getMicrophoneManager().connect).not.toBeCalled();
expect(api.getCardElementManager().update).toBeCalled();
expect(manager.wasEverInitialized()).toBeTruthy();
});
it('successfully with microphone if configured', async () => {