var __async = (__this, __arguments, generator) => {
  return new Promise((resolve, reject) => {
    var fulfilled = (value) => {
      try {
        step(generator.next(value));
      } catch (e) {
        reject(e);
      }
    };
    var rejected = (value) => {
      try {
        step(generator.throw(value));
      } catch (e) {
        reject(e);
      }
    };
    var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
    step((generator = generator.apply(__this, __arguments)).next());
  });
};

// src/relay/pure-relay/extensions/ServerWithExtension.stories.ts
import { graphql } from "react-relay";
import {
  getNovaDecorator
} from "@nova/react-test-utils/relay";
import { MockPayloadGenerator } from "relay-test-utils";
import { ServerWithExtension } from "./ServerWithExtension.mjs";
import { within, expect } from "@storybook/test";
import { schema } from "../../../testing-utils/schema.mjs";
var novaDecorator = getNovaDecorator(schema, {
  generateFunction: (operation, mockResolvers) => {
    const result = MockPayloadGenerator.generate(
      operation,
      mockResolvers != null ? mockResolvers : null,
      {
        mockClientData: true
      }
    );
    return result;
  }
});
var meta = {
  component: ServerWithExtension,
  decorators: [novaDecorator],
  parameters: {
    novaEnvironment: {
      query: graphql`
        query ServerWithExtensionStoryRelayQuery @relay_test_operation {
          serverObjectWithClientExtension {
            ...ServerWithExtension_dataFragment
          }
        }
      `,
      referenceEntries: {
        data: (data) => data == null ? void 0 : data.serverObjectWithClientExtension
      },
      resolvers: {
        ServerObjectWithClientExtension: () => ({
          clientExtension: "This is a client extension field"
        })
      }
    }
  }
};
var ServerWithExtension_stories_default = meta;
var ServerObjectWithClientExtension = {
  parameters: {
    novaEnvironment: {
      resolvers: {
        ServerObjectWithClientExtension: () => ({
          clientExtension: "This is a custom client extension value"
        })
      }
    }
  },
  play: (_0) => __async(void 0, [_0], function* ({ canvasElement }) {
    const canvas = within(canvasElement);
    expect(
      yield canvas.findByText(/This is a custom client extension value/i)
    ).toBeInTheDocument();
  })
};
export {
  ServerObjectWithClientExtension,
  ServerWithExtension_stories_default as default
};
