Skip to content

Commit

Permalink
update prismic-client & prismic-mock
Browse files Browse the repository at this point in the history
  • Loading branch information
xrutayisire committed Sep 10, 2024
1 parent 7074630 commit 28a78db
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 22 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"negotiator": "^0.6.3"
},
"devDependencies": {
"@prismicio/client": "7.9.0-alpha.2",
"@prismicio/mock": "0.3.8-alpha.0",
"@prismicio/client": "7.9.0-alpha.3",
"@prismicio/mock": "0.3.8-alpha.2",
"@size-limit/preset-small-lib": "^9.0.0",
"@types/negotiator": "^0.6.3",
"@types/react-test-renderer": "^18.0.2",
Expand Down Expand Up @@ -101,7 +101,7 @@
"access": "public"
},
"overrides": {
"@prismicio/client": "7.9.0-alpha.2",
"@prismicio/mock": "0.3.8-alpha.0"
"@prismicio/client": "7.9.0-alpha.3",
"@prismicio/mock": "0.3.8-alpha.2"
}
}
10 changes: 8 additions & 2 deletions test/PrismicNextLink.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,10 @@ it("forwards ref", (ctx) => {
});

it("renders a next/link with text", (ctx) => {
const model = ctx.mock.model.link({ text: true, allowTargetBlank: false });
const model = ctx.mock.model.link({
allowText: true,
allowTargetBlank: false,
});
const field = ctx.mock.value.link({ type: "Web", model });

const actual = renderJSON(<PrismicNextLink field={field} />);
Expand All @@ -253,7 +256,10 @@ it("renders a next/link with text", (ctx) => {
});

it("renders a next/link with the given children, overriding the link's text", (ctx) => {
const model = ctx.mock.model.link({ text: true, allowTargetBlank: false });
const model = ctx.mock.model.link({
allowText: true,
allowTargetBlank: false,
});
const field = ctx.mock.value.link({ type: "Web", model });
const children = ctx.mock.value.keyText();

Expand Down
16 changes: 8 additions & 8 deletions test/createLocaleRedirect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ it("creates a redirect with the request's preferred locale", async () => {

mockGetRepository({
client,
languages: [{ id: "fr-fr", name: "French (France)" }],
languages: [{ id: "fr-fr", name: "French (France)", is_master: true }],
});

const redirect = await createLocaleRedirect(config);
Expand All @@ -74,8 +74,8 @@ it("returns undefined if the request already contains a locale", async () => {
mockGetRepository({
client,
languages: [
{ id: "fr-fr", name: "French (France)" },
{ id: "en-us", name: "English (US)" },
{ id: "fr-fr", name: "French (France)", is_master: false },
{ id: "en-us", name: "English (US)", is_master: true },
],
});

Expand All @@ -98,8 +98,8 @@ it("uses the default locale if the request's preferred language is unavailable",
mockGetRepository({
client,
languages: [
{ id: "en-us", name: "English (US)" },
{ id: "en-uk", name: "English (UK)" },
{ id: "en-us", name: "English (US)", is_master: true },
{ id: "en-uk", name: "English (UK)", is_master: false },
],
});

Expand Down Expand Up @@ -127,7 +127,7 @@ it("allows for custom locale codes", async () => {

mockGetRepository({
client,
languages: [{ id: "fr-fr", name: "French (France)" }],
languages: [{ id: "fr-fr", name: "French (France)", is_master: true }],
});

const redirect = await createLocaleRedirect(config);
Expand All @@ -150,7 +150,7 @@ it("returns undefined when omitDefaultLocale is true and the preferred locale is

mockGetRepository({
client,
languages: [{ id: "fr-fr", name: "French (France)" }],
languages: [{ id: "fr-fr", name: "French (France)", is_master: true }],
});

const redirect = await createLocaleRedirect(config);
Expand All @@ -171,7 +171,7 @@ it("uses the default locale when the accept-language header is not set", async (

mockGetRepository({
client,
languages: [{ id: "fr-fr", name: "French (France)" }],
languages: [{ id: "fr-fr", name: "French (France)", is_master: true }],
});

const redirect = await createLocaleRedirect(config);
Expand Down

0 comments on commit 28a78db

Please sign in to comment.