@@ -181,45 +181,32 @@ test.describe('Templates', () => {
181
181
} ) => {
182
182
// Open templates dialog
183
183
await comfyPage . executeCommand ( 'Comfy.BrowseTemplates' )
184
- await expect ( comfyPage . templates . content ) . toBeVisible ( )
185
-
186
- const firstCard = comfyPage . page
187
- . locator ( '[data-testid^="template-workflow-"]' )
188
- . first ( )
189
- await expect ( firstCard ) . toBeVisible ( { timeout : 5000 } )
190
184
191
- // Get the template grid
192
185
const templateGrid = comfyPage . page . locator (
193
186
'[data-testid="template-workflows-content"]'
194
187
)
195
- await expect ( templateGrid ) . toBeVisible ( )
188
+ const nav = comfyPage . page
189
+ . locator ( 'header' )
190
+ . filter ( { hasText : 'Templates' } )
196
191
197
- // Check grid layout at desktop size (default)
198
- const desktopGridClass = await templateGrid . getAttribute ( 'class' )
199
- expect ( desktopGridClass ) . toContain ( 'grid' )
200
- expect ( desktopGridClass ) . toContain (
201
- 'grid-cols-[repeat(auto-fill,minmax(16rem,1fr))]'
202
- )
203
-
204
- // Count visible cards at desktop size
205
- const desktopCardCount = await comfyPage . page
192
+ const cardCount = await comfyPage . page
206
193
. locator ( '[data-testid^="template-workflow-"]' )
207
194
. count ( )
208
- expect ( desktopCardCount ) . toBeGreaterThan ( 0 )
195
+ expect ( cardCount ) . toBeGreaterThan ( 0 )
196
+ await expect ( templateGrid ) . toBeVisible ( )
197
+ await expect ( nav ) . toBeVisible ( ) // Nav should be visible at desktop size
209
198
210
- // Check cards at mobile viewport size
211
- await comfyPage . page . setViewportSize ( { width : 640 , height : 800 } )
199
+ const mobileSize = { width : 640 , height : 800 }
200
+ await comfyPage . page . setViewportSize ( mobileSize )
201
+ expect ( cardCount ) . toBeGreaterThan ( 0 )
212
202
await expect ( templateGrid ) . toBeVisible ( )
213
- // Grid should still be responsive at mobile size
214
- const mobileGridClass = await templateGrid . getAttribute ( 'class' )
215
- expect ( mobileGridClass ) . toContain ( 'grid' )
203
+ await expect ( nav ) . not . toBeVisible ( ) // Nav should collapse at mobile size
216
204
217
- // Check cards at tablet size
218
- await comfyPage . page . setViewportSize ( { width : 1024 , height : 800 } )
205
+ const tabletSize = { width : 1024 , height : 800 }
206
+ await comfyPage . page . setViewportSize ( tabletSize )
207
+ expect ( cardCount ) . toBeGreaterThan ( 0 )
219
208
await expect ( templateGrid ) . toBeVisible ( )
220
- // Grid should still be responsive at tablet size
221
- const tabletGridClass = await templateGrid . getAttribute ( 'class' )
222
- expect ( tabletGridClass ) . toContain ( 'grid' )
209
+ await expect ( nav ) . toBeVisible ( ) // Nav should be visible at tablet size
223
210
} )
224
211
225
212
test ( 'hover effects work on template cards' , async ( { comfyPage } ) => {
0 commit comments