Skip to content

Commit

Permalink
Fix init tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dani-mp committed Jan 29, 2025
1 parent 1c6639e commit dea27e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions packages/init/test/SliceMachineInitProcess-run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ const prepareEnvironment = async (
variations: [ctx.mockPrismic.model.sharedSliceVariation()],
});
const customTypeModel = ctx.mockPrismic.model.customType();
// TODO: update @prismicio/mock so that custom-type includes the "format" property
const customTypeModelWithFormat = { ...customTypeModel, format: "custom" };

const sliceLibraryReadHookHandler = vi.fn(({ libraryID }) => {
if (libraryID === "./slices") {
Expand Down Expand Up @@ -116,7 +114,7 @@ const prepareEnvironment = async (
return res(ctx.status(404));
},
async onCustomTypeInsert(req, res, ctx) {
expect(await req.json()).toStrictEqual(customTypeModelWithFormat);
expect(await req.json()).toStrictEqual(customTypeModel);

return res(ctx.status(201));
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ const mockAdapter = async (
variations: [ctx.mockPrismic.model.sharedSliceVariation()],
});
const customTypeModel = ctx.mockPrismic.model.customType();
// TODO: maybe update @prismic/mock with the new custom-type format
const customTypeModelWithFormat = { ...customTypeModel, format: "custom" };

const sliceLibraryReadHookHandler = vi.fn(({ libraryID }) => {
if (options?.throwsOn?.includes("slice-library:read")) {
Expand Down Expand Up @@ -131,7 +129,7 @@ const mockAdapter = async (
adapter,
models: {
sharedSliceModel,
customTypeModel: customTypeModelWithFormat,
customTypeModel,
},
spiedHookHandlers: {
sliceLibraryReadHookHandler,
Expand Down

0 comments on commit dea27e4

Please sign in to comment.