Skip to content

Commit

Permalink
feat: add fixture for grower image
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-rice committed Apr 11, 2024
1 parent 3bb97e4 commit bc32ecc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Binary file added cypress/fixtures/images/grower.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion cypress/tests/integration/growers/[growerid].cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ beforeEach(() => {
describe('Grower Page', () => {
it('renders with grower data', () => {
const path = `/growers/${grower.id}`;
prepareNocks({ grower });
const imageFixturePath = `images/grower.png`;
cy.fixture(imageFixturePath).then((image) => {
const blob = Cypress.Blob.base64StringToBlob(image, 'image/png');
const image_url = Cypress.Blob.createObjectURL(blob);
prepareNocks({ grower: { ...grower, image_url } });
});

cy.visit(path, {
failOnStatusCode: false,
Expand Down

0 comments on commit bc32ecc

Please sign in to comment.