Skip to content

Commit

Permalink
Fix img tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Oct 22, 2019
1 parent 6540f55 commit 0e9cf82
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/unit/test-amp-img.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ describe('amp-img', () => {
it('should propagate the object-fit attribute', () => {
return getImg({
src: '/examples/img/sample.jpg',
width: 300,
height: 200,
'object-fit': 'cover',
}).then(ampImg => {
const img = ampImg.querySelector('img');
Expand All @@ -387,6 +389,8 @@ describe('amp-img', () => {
it('should not propagate the object-fit attribute if invalid', () => {
return getImg({
src: '/examples/img/sample.jpg',
width: 300,
height: 200,
'object-fit': 'foo 80%',
}).then(ampImg => {
const img = ampImg.querySelector('img');
Expand All @@ -397,6 +401,8 @@ describe('amp-img', () => {
it('should propagate the object-position attribute', () => {
return getImg({
src: '/examples/img/sample.jpg',
width: 300,
height: 200,
'object-position': '20% 80%',
}).then(ampImg => {
const img = ampImg.querySelector('img');
Expand All @@ -407,6 +413,8 @@ describe('amp-img', () => {
it('should not propagate the object-position attribute if invalid', () => {
return getImg({
src: '/examples/img/sample.jpg',
width: 300,
height: 200,
'object-position': 'url("example.com")',
}).then(ampImg => {
const img = ampImg.querySelector('img');
Expand Down

0 comments on commit 0e9cf82

Please sign in to comment.