@@ -33,13 +33,13 @@ function runTests() {
3333 } )
3434 it ( 'should modify src with the loader' , async ( ) => {
3535 expect ( await browser . elementById ( 'basic-image' ) . getAttribute ( 'src' ) ) . toBe (
36- 'https://example.com/myaccount/foo.jpg?auto=format&w=1600 &q=60'
36+ 'https://example.com/myaccount/foo.jpg?auto=format&w=480 &q=60'
3737 )
3838 } )
3939 it ( 'should correctly generate src even if preceding slash is included in prop' , async ( ) => {
4040 expect (
4141 await browser . elementById ( 'preceding-slash-image' ) . getAttribute ( 'src' )
42- ) . toBe ( 'https://example.com/myaccount/fooslash.jpg?auto=format&w=1600 ' )
42+ ) . toBe ( 'https://example.com/myaccount/fooslash.jpg?auto=format&w=480 ' )
4343 } )
4444 it ( 'should add a srcset based on the loader' , async ( ) => {
4545 expect (
@@ -49,9 +49,7 @@ function runTests() {
4949 it ( 'should add a srcset even with preceding slash in prop' , async ( ) => {
5050 expect (
5151 await browser . elementById ( 'preceding-slash-image' ) . getAttribute ( 'srcset' )
52- ) . toBe (
53- 'https://example.com/myaccount/fooslash.jpg?auto=format&w=480 480w, https://example.com/myaccount/fooslash.jpg?auto=format&w=1024 1024w'
54- )
52+ ) . toBe ( 'https://example.com/myaccount/fooslash.jpg?auto=format&w=480 480w' )
5553 } )
5654 it ( 'should support the unoptimized attribute' , async ( ) => {
5755 expect (
@@ -68,7 +66,7 @@ function runTests() {
6866function lazyLoadingTests ( ) {
6967 it ( 'should have loaded the first image immediately' , async ( ) => {
7068 expect ( await browser . elementById ( 'lazy-top' ) . getAttribute ( 'src' ) ) . toBe (
71- 'https://example.com/myaccount/foo1.jpg?auto=format&w=1600 '
69+ 'https://example.com/myaccount/foo1.jpg?auto=format&w=1024 '
7270 )
7371 expect ( await browser . elementById ( 'lazy-top' ) . getAttribute ( 'srcset' ) ) . toBe (
7472 'https://example.com/myaccount/foo1.jpg?auto=format&w=480 480w, https://example.com/myaccount/foo1.jpg?auto=format&w=1024 1024w'
@@ -99,7 +97,7 @@ function lazyLoadingTests() {
9997
10098 await check ( ( ) => {
10199 return browser . elementById ( 'lazy-mid' ) . getAttribute ( 'src' )
102- } , 'https://example.com/myaccount/foo2.jpg?auto=format&w=1600 ' )
100+ } , 'https://example.com/myaccount/foo2.jpg?auto=format&w=480 ' )
103101
104102 await check ( ( ) => {
105103 return browser . elementById ( 'lazy-mid' ) . getAttribute ( 'srcset' )
@@ -148,17 +146,17 @@ function lazyLoadingTests() {
148146 await waitFor ( 200 )
149147 expect (
150148 await browser . elementById ( 'lazy-without-attribute' ) . getAttribute ( 'src' )
151- ) . toBe ( 'https://example.com/myaccount/foo4.jpg?auto=format&w=1600 ' )
149+ ) . toBe ( 'https://example.com/myaccount/foo4.jpg?auto=format&w=1024 ' )
152150 expect (
153151 await browser . elementById ( 'lazy-without-attribute' ) . getAttribute ( 'srcset' )
154152 ) . toBe (
155- 'https://example.com/myaccount/foo4.jpg?auto=format&w=480&q=60 480w, https://example.com/myaccount/foo4.jpg?auto=format&w=1024&q=60 1024w, https://example.com/myaccount/foo4.jpg?auto=format&w=1600&q=60 1600w '
153+ 'https://example.com/myaccount/foo4.jpg?auto=format&w=480 480w, https://example.com/myaccount/foo4.jpg?auto=format&w=1024 1024w'
156154 )
157155 } )
158156
159157 it ( 'should load the fifth image eagerly, without scrolling' , async ( ) => {
160158 expect ( await browser . elementById ( 'eager-loading' ) . getAttribute ( 'src' ) ) . toBe (
161- 'https://example.com/myaccount/foo5.jpg?auto=format&w=1600 '
159+ 'https://example.com/myaccount/foo5.jpg?auto=format&w=2000 '
162160 )
163161 expect (
164162 await browser . elementById ( 'eager-loading' ) . getAttribute ( 'srcset' )
@@ -198,14 +196,14 @@ describe('Image Component Tests', () => {
198196 it ( 'should add a preload tag for a priority image' , async ( ) => {
199197 expect (
200198 await hasPreloadLinkMatchingUrl (
201- 'https://example.com/myaccount/withpriority.png?auto=format&w=1600 '
199+ 'https://example.com/myaccount/withpriority.png?auto=format&w=480&q=60 '
202200 )
203201 ) . toBe ( true )
204202 } )
205203 it ( 'should add a preload tag for a priority image with preceding slash' , async ( ) => {
206204 expect (
207205 await hasPreloadLinkMatchingUrl (
208- 'https://example.com/myaccount/fooslash.jpg?auto=format&w=1600 '
206+ 'https://example.com/myaccount/fooslash.jpg?auto=format&w=480 '
209207 )
210208 ) . toBe ( true )
211209 } )
@@ -219,7 +217,7 @@ describe('Image Component Tests', () => {
219217 it ( 'should add a preload tag for a priority image, with quality' , async ( ) => {
220218 expect (
221219 await hasPreloadLinkMatchingUrl (
222- 'https://example.com/myaccount/withpriority.png?auto=format&w=1600 &q=60'
220+ 'https://example.com/myaccount/withpriority.png?auto=format&w=480 &q=60'
223221 )
224222 ) . toBe ( true )
225223 } )
0 commit comments