From da19a5f8a01518ef502796ed2641d2806206b43e Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Wed, 13 Mar 2024 15:04:59 +0100 Subject: [PATCH] adjust integration tests to new inheritance --- integration-test/jest/src/hooks.test.jsx | 12 +++++++++++- integration-test/vitest/src/hooks.test.jsx | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/integration-test/jest/src/hooks.test.jsx b/integration-test/jest/src/hooks.test.jsx index d6753a3b..c16a8f98 100644 --- a/integration-test/jest/src/hooks.test.jsx +++ b/integration-test/jest/src/hooks.test.jsx @@ -24,7 +24,17 @@ afterEach(resetNextSSRApolloSingletons); * data from the server to the browser. */ test("uses the browser build", () => { - expect(NextSSRApolloClient.name).toBe("ApolloClientBrowserImpl"); + let foundPrototype = false; + let proto = NextSSRApolloClient; + while (proto) { + if (proto.name === "ApolloClientBrowserImpl") { + foundPrototype = true; + break; + } + proto = Object.getPrototypeOf(proto); + } + + expect(foundPrototype).toBe(true); }); /** diff --git a/integration-test/vitest/src/hooks.test.jsx b/integration-test/vitest/src/hooks.test.jsx index d6753a3b..c16a8f98 100644 --- a/integration-test/vitest/src/hooks.test.jsx +++ b/integration-test/vitest/src/hooks.test.jsx @@ -24,7 +24,17 @@ afterEach(resetNextSSRApolloSingletons); * data from the server to the browser. */ test("uses the browser build", () => { - expect(NextSSRApolloClient.name).toBe("ApolloClientBrowserImpl"); + let foundPrototype = false; + let proto = NextSSRApolloClient; + while (proto) { + if (proto.name === "ApolloClientBrowserImpl") { + foundPrototype = true; + break; + } + proto = Object.getPrototypeOf(proto); + } + + expect(foundPrototype).toBe(true); }); /**