Skip to content

Commit

Permalink
test: placeholder imgix params
Browse files Browse the repository at this point in the history
  • Loading branch information
frederickfogerty committed Mar 26, 2021
1 parent b4b2500 commit 63d73b7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/unit/source-url/source-url.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,22 @@ describe('createResolvers', () => {

expect(result.backgroundColor).toMatch(/^#([0-9A-F]{3}){1,2}$/i);
});

it('should be able to set custom placeholder parameters in placeholderImgixParams', async () => {
const result = await resolveField({
field: 'gatsbyImageData',
url: 'amsterdam.jpg',
fieldParams: {
placeholder: 'dominantColor',
placeholderImgixParams: {
hue: 180,
},
},
});

// Bit flaky here to hard code a colour value, but I wanted to make sure that it was different to the above test
expect(result.backgroundColor).toMatch('#348ff2');
});
});
});

Expand Down

0 comments on commit 63d73b7

Please sign in to comment.