@@ -33,13 +33,13 @@ function runTests() {
33
33
} )
34
34
it ( 'should modify src with the loader' , async ( ) => {
35
35
expect ( await browser . elementById ( 'basic-image' ) . getAttribute ( 'src' ) ) . toBe (
36
- 'https://example.com/myaccount/foo.jpg?auto=format&q=60'
36
+ 'https://example.com/myaccount/foo.jpg?auto=format&w=1600& q=60'
37
37
)
38
38
} )
39
39
it ( 'should correctly generate src even if preceding slash is included in prop' , async ( ) => {
40
40
expect (
41
41
await browser . elementById ( 'preceding-slash-image' ) . getAttribute ( 'src' )
42
- ) . toBe ( 'https://example.com/myaccount/fooslash.jpg?auto=format' )
42
+ ) . toBe ( 'https://example.com/myaccount/fooslash.jpg?auto=format&w=1600 ' )
43
43
} )
44
44
it ( 'should add a srcset based on the loader' , async ( ) => {
45
45
expect (
@@ -70,7 +70,7 @@ function runTests() {
70
70
function lazyLoadingTests ( ) {
71
71
it ( 'should have loaded the first image immediately' , async ( ) => {
72
72
expect ( await browser . elementById ( 'lazy-top' ) . getAttribute ( 'src' ) ) . toBe (
73
- 'https://example.com/myaccount/foo1.jpg?auto=format'
73
+ 'https://example.com/myaccount/foo1.jpg?auto=format&w=1600 '
74
74
)
75
75
expect ( await browser . elementById ( 'lazy-top' ) . getAttribute ( 'srcset' ) ) . toBe (
76
76
'https://example.com/myaccount/foo1.jpg?auto=format&w=480 480w, https://example.com/myaccount/foo1.jpg?auto=format&w=1024 1024w, https://example.com/myaccount/foo1.jpg?auto=format&w=1600 1600w'
@@ -101,7 +101,7 @@ function lazyLoadingTests() {
101
101
102
102
await check ( ( ) => {
103
103
return browser . elementById ( 'lazy-mid' ) . getAttribute ( 'src' )
104
- } , 'https://example.com/myaccount/foo2.jpg?auto=format' )
104
+ } , 'https://example.com/myaccount/foo2.jpg?auto=format&w=1600 ' )
105
105
106
106
await check ( ( ) => {
107
107
return browser . elementById ( 'lazy-mid' ) . getAttribute ( 'srcset' )
@@ -150,15 +150,15 @@ function lazyLoadingTests() {
150
150
await waitFor ( 200 )
151
151
expect (
152
152
await browser . elementById ( 'lazy-without-attribute' ) . getAttribute ( 'src' )
153
- ) . toBe ( 'https://example.com/myaccount/foo4.jpg?auto=format' )
153
+ ) . toBe ( 'https://example.com/myaccount/foo4.jpg?auto=format&w=1600 ' )
154
154
expect (
155
155
await browser . elementById ( 'lazy-without-attribute' ) . getAttribute ( 'srcset' )
156
156
) . toBeTruthy ( )
157
157
} )
158
158
159
159
it ( 'should load the fifth image eagerly, without scrolling' , async ( ) => {
160
160
expect ( await browser . elementById ( 'eager-loading' ) . getAttribute ( 'src' ) ) . toBe (
161
- 'https://example.com/myaccount/foo5.jpg?auto=format'
161
+ 'https://example.com/myaccount/foo5.jpg?auto=format&w=1600 '
162
162
)
163
163
expect (
164
164
await browser . elementById ( 'eager-loading' ) . getAttribute ( 'srcset' )
@@ -198,14 +198,14 @@ describe('Image Component Tests', () => {
198
198
it ( 'should add a preload tag for a priority image' , async ( ) => {
199
199
expect (
200
200
await hasPreloadLinkMatchingUrl (
201
- 'https://example.com/myaccount/withpriority.png?auto=format'
201
+ 'https://example.com/myaccount/withpriority.png?auto=format&w=1600 '
202
202
)
203
203
) . toBe ( true )
204
204
} )
205
205
it ( 'should add a preload tag for a priority image with preceding slash' , async ( ) => {
206
206
expect (
207
207
await hasPreloadLinkMatchingUrl (
208
- 'https://example.com/myaccount/fooslash.jpg?auto=format'
208
+ 'https://example.com/myaccount/fooslash.jpg?auto=format&w=1600 '
209
209
)
210
210
) . toBe ( true )
211
211
} )
@@ -219,7 +219,7 @@ describe('Image Component Tests', () => {
219
219
it ( 'should add a preload tag for a priority image, with quality' , async ( ) => {
220
220
expect (
221
221
await hasPreloadLinkMatchingUrl (
222
- 'https://example.com/myaccount/withpriority.png?auto=format&q=60'
222
+ 'https://example.com/myaccount/withpriority.png?auto=format&w=1600& q=60'
223
223
)
224
224
) . toBe ( true )
225
225
} )
0 commit comments