var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
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/Feedback/Feedback.test.error.tsx
import { expect, it, describe, vi } from "vitest";
import { composeStory } from "@storybook/react";
import * as stories from "./Feedback.stories.mjs";
import { render } from "vitest-browser-react";
import * as React from "react";
var mockOnError = vi.fn();
var Primary2 = composeStory(stories.Primary, __spreadProps(__spreadValues({}, stories.default), {
  parameters: __spreadProps(__spreadValues({}, stories.default.parameters), {
    errorBoundary: {
      onError: mockOnError
    }
  })
}));
describe("Feedback", () => {
  it("throws an error when artifact loader is not configured", () => __async(void 0, null, function* () {
    render(/* @__PURE__ */ React.createElement(Primary2, null));
    yield vi.waitFor(() => {
      expect(mockOnError).toHaveBeenCalledTimes(1);
    });
    const call = mockOnError.mock.calls[0];
    expect(call[0].message).toBe(
      "Failed to load GraphQL artifact, got raw document instead. Make sure you have configured a loader (e.g., webpack loader, swc plugin) for working with compiled artifacts. Check https://github.com/microsoft/nova-facade/tree/main/packages/nova-react-test-utils#prerequisites, for more information."
    );
  }));
});
