ResponsiveImagesCG / wp-tevko-responsive-images

Fully responsive image plugin for wordpress
449 stars 53 forks source link

Default theme image options can make test fail #261

Closed joemcgill closed 8 years ago

joemcgill commented 8 years ago

Once WP changed the default theme to Twenty Sixteen, several of our tests began failing because Twenty Sixteen includes support for a soft-cropped 'post-thumbnail' image size. See: https://core.trac.wordpress.org/ticket/34790

There are a few ways we can fix these tests. The first, which you can see in this patch to the original ticket, is to loop through all the defined image sizes and assume they will be included in expected srcset attributes.

Another, is to unhook the theme setup functions for Twenty Sixteen before our tests run, which is how the Customizer tests work, see Konstantin's comment here: https://core.trac.wordpress.org/ticket/34790#comment:3

The other thing we can do is mock the data we want to use in our tests rather than using a real upload.

joemcgill commented 8 years ago

Fixes landed here: https://core.trac.wordpress.org/changeset/35751

We need to apply the same fixes here.

joemcgill commented 8 years ago

Fixed in #262