Skip to content

Commit 4ebd47f

Browse files
committed
Add touch device fixture and update test payload
Add a 'test_touch' device to the test devices (features: lcd + touch, touch.platform: gt911) and modify the touch_area test to set deviceModel: 'test_touch' in the payload. The profile.touch flag was removed so the test relies on the device model to indicate touch capability when generating YAML.
1 parent 66ae96c commit 4ebd47f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

custom_components/esphome_designer/frontend/tests/verify_widget_restoration.test.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ describe('Widget Restoration Verification', () => {
2828
name: 'Test LCD',
2929
features: { lcd: true },
3030
width: 320, height: 240
31+
},
32+
'test_touch': {
33+
name: 'Test Touch Device',
34+
features: { lcd: true, touch: true },
35+
touch: { platform: 'gt911' },
36+
width: 320, height: 240
3137
}
3238
};
3339
});
@@ -95,6 +101,7 @@ describe('Widget Restoration Verification', () => {
95101

96102
it('should generate valid YAML for touch_area', async () => {
97103
const payload = {
104+
deviceModel: 'test_touch',
98105
pages: [{
99106
widgets: [{
100107
id: 't1',
@@ -103,8 +110,7 @@ describe('Widget Restoration Verification', () => {
103110
entity_id: 'light.test',
104111
props: { icon: 'mdi:test' }
105112
}]
106-
}],
107-
profile: { name: 'Test Device', touch: true }
113+
}]
108114
};
109115

110116
const yaml = await adapter.generate(payload);

0 commit comments

Comments
 (0)