@@ -58,7 +58,7 @@ describe('pi-crust.ts', () => {
5858 // Mock device
5959 mockDevice = {
6060 device_id : 'adguard_device' ,
61- status : {
61+ protection : {
6262 entity_id : 'binary_sensor.pi_hole_status' ,
6363 state : 'on' ,
6464 attributes : { friendly_name : 'Pi-hole Status' } ,
@@ -161,7 +161,7 @@ describe('pi-crust.ts', () => {
161161
162162 it ( 'should display green status when Pi-hole is active' , async ( ) => {
163163 // Ensure status is 'on'
164- mockSetup . holes [ 0 ] ! . status ! . state = 'on' ;
164+ mockSetup . holes [ 0 ] ! . protection ! . state = 'on' ;
165165
166166 // Render the card header
167167 const result = createCardHeader (
@@ -186,7 +186,7 @@ describe('pi-crust.ts', () => {
186186
187187 it ( 'should display red status when Pi-hole is inactive' , async ( ) => {
188188 // Set status to 'off'
189- mockSetup . holes [ 0 ] ! . status ! . state = 'off' ;
189+ mockSetup . holes [ 0 ] ! . protection ! . state = 'off' ;
190190
191191 // Render the card header
192192 const result = createCardHeader (
@@ -214,11 +214,11 @@ describe('pi-crust.ts', () => {
214214 createCardHeader ( mockElement , mockSetup , mockHass , mockConfig ) ;
215215
216216 // Verify stateDisplay was called with the correct parameters
217- expect ( stateDisplayStub . calledWith ( mockHass , mockSetup . holes [ 0 ] ! . status ) ) . to
218- . be . true ;
217+ expect (
218+ stateDisplayStub . calledWith ( mockHass , mockSetup . holes [ 0 ] ! . protection ) ,
219+ ) . to . be . true ;
219220 } ) ;
220221
221-
222222 // New tests for multiple Pi-hole setup
223223
224224 it ( 'should not display hole count when only one Pi-hole is configured' , async ( ) => {
@@ -241,8 +241,8 @@ describe('pi-crust.ts', () => {
241241 const secondDevice = {
242242 ...mockDevice ,
243243 device_id : 'adguard_device_2' ,
244- status : {
245- ...mockDevice . status ,
244+ protection : {
245+ ...mockDevice . protection ,
246246 entity_id : 'binary_sensor.pi_hole_2_status' ,
247247 state : 'on' ,
248248 } ,
@@ -269,8 +269,8 @@ describe('pi-crust.ts', () => {
269269 const secondDevice = {
270270 ...mockDevice ,
271271 device_id : 'adguard_device_2' ,
272- status : {
273- ...mockDevice . status ,
272+ protection : {
273+ ...mockDevice . protection ,
274274 entity_id : 'binary_sensor.pi_hole_2_status' ,
275275 state : 'off' ,
276276 } ,
@@ -301,8 +301,8 @@ describe('pi-crust.ts', () => {
301301 const secondDevice = {
302302 ...mockDevice ,
303303 device_id : 'adguard_device_2' ,
304- status : {
305- ...mockDevice . status ,
304+ protection : {
305+ ...mockDevice . protection ,
306306 entity_id : 'binary_sensor.pi_hole_2_status' ,
307307 state : 'off' ,
308308 } ,
@@ -311,8 +311,8 @@ describe('pi-crust.ts', () => {
311311 const thirdDevice = {
312312 ...mockDevice ,
313313 device_id : 'adguard_device_3' ,
314- status : {
315- ...mockDevice . status ,
314+ protection : {
315+ ...mockDevice . protection ,
316316 entity_id : 'binary_sensor.pi_hole_3_status' ,
317317 state : 'on' ,
318318 } ,
@@ -339,7 +339,7 @@ describe('pi-crust.ts', () => {
339339 const deviceWithoutStatus = {
340340 ...mockDevice ,
341341 device_id : 'adguard_device_2' ,
342- status : undefined ,
342+ protection : undefined ,
343343 } ;
344344
345345 mockSetup . holes . push ( deviceWithoutStatus ) ;
0 commit comments