@@ -96,14 +96,14 @@ describe("BannerVideo", () => {
9696 expect ( wrapper . find ( "video" ) . attributes ( "poster" ) ) . toBe ( defaultProps . poster ) ;
9797 } ) ;
9898
99- it ( "source element has the correct src" , async ( ) => {
99+ it ( "video element has the correct src" , async ( ) => {
100100 const wrapper = await mountSuspended ( BannerVideo , { props : defaultProps } ) ;
101- expect ( wrapper . find ( "source " ) . attributes ( "src" ) ) . toBe ( defaultProps . src ) ;
101+ expect ( wrapper . find ( "video " ) . attributes ( "src" ) ) . toBe ( defaultProps . src ) ;
102102 } ) ;
103103
104- it ( "source element has type video/mp4 " , async ( ) => {
104+ it ( "video element has preload=auto " , async ( ) => {
105105 const wrapper = await mountSuspended ( BannerVideo , { props : defaultProps } ) ;
106- expect ( wrapper . find ( "source " ) . attributes ( "type " ) ) . toBe ( "video/mp4 " ) ;
106+ expect ( wrapper . find ( "video " ) . attributes ( "preload " ) ) . toBe ( "auto " ) ;
107107 } ) ;
108108
109109 // ─── Fallback image ──────────────────────────────────────────────────────
@@ -165,27 +165,6 @@ describe("BannerVideo", () => {
165165 expect ( wrapper . find ( "img[data-nuxt-img]" ) . attributes ( "decoding" ) ) . toBe ( "async" ) ;
166166 } ) ;
167167
168- // ─── Video error handling ────────────────────────────────────────────────
169-
170- it ( "does not have video-failed class initially" , async ( ) => {
171- const wrapper = await mountSuspended ( BannerVideo , { props : defaultProps } ) ;
172- expect ( wrapper . classes ( ) ) . not . toContain ( "video-failed" ) ;
173- } ) ;
174-
175- it ( "adds video-failed class when video fires an error event" , async ( ) => {
176- const wrapper = await mountSuspended ( BannerVideo , { props : defaultProps } ) ;
177- await wrapper . find ( "video" ) . trigger ( "error" ) ;
178- await nextTick ( ) ;
179- expect ( wrapper . classes ( ) ) . toContain ( "video-failed" ) ;
180- } ) ;
181-
182- it ( "adds video-failed class when source fires an error event" , async ( ) => {
183- const wrapper = await mountSuspended ( BannerVideo , { props : defaultProps } ) ;
184- await wrapper . find ( "source" ) . trigger ( "error" ) ;
185- await nextTick ( ) ;
186- expect ( wrapper . classes ( ) ) . toContain ( "video-failed" ) ;
187- } ) ;
188-
189168 // ─── CSS custom properties ───────────────────────────────────────────────
190169
191170 it ( "sets --_max-height to 56rem by default" , async ( ) => {
0 commit comments