Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
styfle committed Oct 14, 2022
1 parent cc5ddc1 commit d01bef2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/unit/next-image-new.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import cheerio from 'cheerio'
describe('Image rendering', () => {
it('should render Image on its own', async () => {
const element = React.createElement(Image, {
alt: 'unit-image',
id: 'unit-image',
src: '/test.png',
width: 100,
Expand All @@ -23,18 +24,21 @@ describe('Image rendering', () => {

it('should only render noscript element when lazy loading', async () => {
const element = React.createElement(Image, {
alt: 'test',
src: '/test.png',
width: 100,
height: 100,
loading: 'eager',
})
const element2 = React.createElement(Image, {
alt: 'test',
src: '/test.png',
width: 100,
height: 100,
priority: true,
})
const elementLazy = React.createElement(Image, {
alt: 'test',
src: '/test.png',
width: 100,
height: 100,
Expand All @@ -49,6 +53,7 @@ describe('Image rendering', () => {

it('should not render noscript', async () => {
const element1 = React.createElement(Image, {
alt: 'test',
src: '/test.png',
width: 100,
height: 100,
Expand All @@ -57,6 +62,7 @@ describe('Image rendering', () => {
blurDataURL: 'data:image/png;base64',
})
const element2 = React.createElement(Image, {
alt: 'test',
src: '/test.png',
width: 100,
height: 100,
Expand All @@ -65,6 +71,7 @@ describe('Image rendering', () => {
loading: 'eager',
})
const element3 = React.createElement(Image, {
alt: 'test',
src: '/test.png',
width: 100,
height: 100,
Expand Down

0 comments on commit d01bef2

Please sign in to comment.