@@ -107,12 +107,12 @@ describe('game_detail.js', () => {
107107 game_modes : [ { name : 'Single player' } ] ,
108108 player_perspectives : [ { name : 'First person' } ] ,
109109 } ) ;
110- expect ( document . getElementById ( 'game-badges' ) . children . length ) . toBe ( 4 ) ;
110+ expect ( document . getElementById ( 'game-badges' ) . children ) . toHaveLength ( 4 ) ;
111111 } ) ;
112112
113113 test ( 'handles missing badge arrays gracefully' , ( ) => {
114114 renderGameBadges ( { } ) ;
115- expect ( document . getElementById ( 'game-badges' ) . children . length ) . toBe ( 0 ) ;
115+ expect ( document . getElementById ( 'game-badges' ) . children ) . toHaveLength ( 0 ) ;
116116 } ) ;
117117 } ) ;
118118
@@ -136,15 +136,15 @@ describe('game_detail.js', () => {
136136 test ( 'skips when no ratings' , ( ) => {
137137 const dl = document . getElementById ( 'game-meta' ) ;
138138 renderGameRatings ( { } , dl ) ;
139- expect ( dl . children . length ) . toBe ( 0 ) ;
139+ expect ( dl . children ) . toHaveLength ( 0 ) ;
140140 } ) ;
141141
142142 test ( 'skips age ratings row when all entries are incomplete' , ( ) => {
143143 const dl = document . getElementById ( 'game-meta' ) ;
144144 renderGameRatings ( {
145145 age_ratings : [ { rating_category : null , organization : null } ] ,
146146 } , dl ) ;
147- expect ( dl . children . length ) . toBe ( 0 ) ;
147+ expect ( dl . children ) . toHaveLength ( 0 ) ;
148148 } ) ;
149149 } ) ;
150150
@@ -174,7 +174,7 @@ describe('game_detail.js', () => {
174174 test ( 'skips when no platforms' , ( ) => {
175175 const dl = document . getElementById ( 'game-meta' ) ;
176176 renderGamePlatforms ( { } , dl ) ;
177- expect ( dl . children . length ) . toBe ( 0 ) ;
177+ expect ( dl . children ) . toHaveLength ( 0 ) ;
178178 } ) ;
179179 } ) ;
180180
@@ -195,13 +195,13 @@ describe('game_detail.js', () => {
195195 test ( 'skips when no release dates' , ( ) => {
196196 const dl = document . getElementById ( 'game-meta' ) ;
197197 renderReleaseDates ( { } , dl ) ;
198- expect ( dl . children . length ) . toBe ( 0 ) ;
198+ expect ( dl . children ) . toHaveLength ( 0 ) ;
199199 } ) ;
200200
201201 test ( 'skips row when all entries lack date and y' , ( ) => {
202202 const dl = document . getElementById ( 'game-meta' ) ;
203203 renderReleaseDates ( { release_dates : [ { date : null , y : null } ] } , dl ) ;
204- expect ( dl . children . length ) . toBe ( 0 ) ;
204+ expect ( dl . children ) . toHaveLength ( 0 ) ;
205205 } ) ;
206206
207207 test ( 'renders release date with unknown release_region (empty flag)' , ( ) => {
@@ -239,13 +239,13 @@ describe('game_detail.js', () => {
239239 test ( 'skips when no involved companies' , ( ) => {
240240 const dl = document . getElementById ( 'game-meta' ) ;
241241 renderCompanies ( { } , dl ) ;
242- expect ( dl . children . length ) . toBe ( 0 ) ;
242+ expect ( dl . children ) . toHaveLength ( 0 ) ;
243243 } ) ;
244244
245245 test ( 'skips rows when devs or pubs list is empty' , ( ) => {
246246 const dl = document . getElementById ( 'game-meta' ) ;
247247 renderCompanies ( { involved_companies : [ ] } , dl ) ;
248- expect ( dl . children . length ) . toBe ( 0 ) ;
248+ expect ( dl . children ) . toHaveLength ( 0 ) ;
249249 } ) ;
250250 } ) ;
251251
@@ -302,7 +302,7 @@ describe('game_detail.js', () => {
302302 test ( 'skips franchise when neither franchises array nor franchise object' , ( ) => {
303303 const dl = document . getElementById ( 'game-meta' ) ;
304304 renderCollectionsAndFranchises ( { } , dl ) ;
305- expect ( dl . children . length ) . toBe ( 0 ) ;
305+ expect ( dl . children ) . toHaveLength ( 0 ) ;
306306 } ) ;
307307 } ) ;
308308
@@ -318,13 +318,13 @@ describe('game_detail.js', () => {
318318 test ( 'skips when no multiplayer modes' , ( ) => {
319319 const dl = document . getElementById ( 'game-meta' ) ;
320320 renderMultiplayer ( { } , dl ) ;
321- expect ( dl . children . length ) . toBe ( 0 ) ;
321+ expect ( dl . children ) . toHaveLength ( 0 ) ;
322322 } ) ;
323323
324324 test ( 'skips when parts are empty' , ( ) => {
325325 const dl = document . getElementById ( 'game-meta' ) ;
326326 renderMultiplayer ( { multiplayer_modes : [ { } ] } , dl ) ;
327- expect ( dl . children . length ) . toBe ( 0 ) ;
327+ expect ( dl . children ) . toHaveLength ( 0 ) ;
328328 } ) ;
329329 } ) ;
330330
@@ -339,7 +339,7 @@ describe('game_detail.js', () => {
339339 const section = document . getElementById ( 'game-screenshots-section' ) ;
340340 expect ( section . classList . contains ( 'd-none' ) ) . toBe ( false ) ;
341341 const buttons = document . querySelectorAll ( '#game-screenshots button' ) ;
342- expect ( buttons . length ) . toBe ( 2 ) ;
342+ expect ( buttons ) . toHaveLength ( 2 ) ;
343343 buttons [ 0 ] . click ( ) ;
344344 expect ( globalThis . openImageModal ) . toHaveBeenCalled ( ) ;
345345 } ) ;
@@ -365,7 +365,7 @@ describe('game_detail.js', () => {
365365
366366 test ( 'skips video entries without video_id' , ( ) => {
367367 renderVideos ( { videos : [ { name : 'No ID' } ] } ) ;
368- expect ( document . querySelectorAll ( '#game-videos iframe' ) . length ) . toBe ( 0 ) ;
368+ expect ( document . querySelectorAll ( '#game-videos iframe' ) ) . toHaveLength ( 0 ) ;
369369 } ) ;
370370
371371 test ( 'skips when no videos' , ( ) => {
@@ -406,7 +406,7 @@ describe('game_detail.js', () => {
406406
407407 test ( 'skips entries with no url and no uid' , ( ) => {
408408 renderExternalLinks ( { external_games : [ { } ] } ) ;
409- expect ( document . getElementById ( 'game-external' ) . children . length ) . toBe ( 0 ) ;
409+ expect ( document . getElementById ( 'game-external' ) . children ) . toHaveLength ( 0 ) ;
410410 } ) ;
411411
412412 test ( 'skips when no external_games' , ( ) => {
@@ -509,7 +509,7 @@ describe('game_detail.js', () => {
509509 introHeader . appendChild ( existingDesc ) ;
510510 // Should not add a second img-desc
511511 setupGameBanner ( { artworks : [ { url : '//images.igdb.com/t_thumb/art.jpg' } ] } ) ;
512- expect ( document . querySelectorAll ( '.intro-header .img-desc' ) . length ) . toBe ( 1 ) ;
512+ expect ( document . querySelectorAll ( '.intro-header .img-desc' ) ) . toHaveLength ( 1 ) ;
513513 } ) ;
514514
515515 test ( 'does not throw when artworks present but no .page-heading anywhere' , ( ) => {
0 commit comments