Skip to content

Commit 857541c

Browse files
author
Antonino Piazza
committed
fix: Hold to reset no longer working #20
1 parent 922f230 commit 857541c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/__tests__/datetime/datetime.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ describe("datetime", () => {
3535
const hass = { states: { test: { attributes: { friendly_name: "friendly name" } } } } as any;
3636
const entity = { id: "test" } as any;
3737
const element = document.createElement("ha-call-service-button") as any;
38-
element.buttonTapped = jest.fn();
38+
element._buttonTapped = jest.fn();
3939
setDatetimeServiceFactoryMock.mockReturnValue(element);
4040

4141
resetDate($event, hass, entity);
4242

4343
expect(setDatetimeServiceFactoryMock).toBeCalledWith(hass, "Do you want to reset friendly name?", "test", expect.anything());
44-
expect(element.buttonTapped).toBeCalled();
44+
expect(element._buttonTapped).toBeCalled();
4545
});
4646
});

src/datetime/datetime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function resetDate($event: Event, hass: IHass, entity: IEntity): void {
2424
localDate
2525
);
2626
(<any>$event.target).appendChild(element);
27-
(<any>element).buttonTapped();
27+
(<any>element)._buttonTapped();
2828
(<any>$event.target).removeChild(element);
2929
}
3030

0 commit comments

Comments
 (0)