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/SuggestedFriends/SuggestedFriends.stories.tsx
import { graphql } from "react-relay";
import {
  getNovaDecorator
} from "@nova/react-test-utils/relay";
import { within, expect } from "@storybook/test";
import { schema } from "../../../testing-utils/schema.mjs";
import { SuggestedFriendsComponent } from "./SuggestedFriends.mjs";
var novaDecorator = getNovaDecorator(schema, {
  getEnvironmentOptions: () => ({
    storeOptions: {}
  })
});
var meta = {
  component: SuggestedFriendsComponent,
  decorators: [novaDecorator],
  parameters: {
    novaEnvironment: {
      query: graphql`
        query SuggestedFriendsStoryQuery @relay_test_operation {
          viewer {
            ...SuggestedFriends_suggestedFriendsFragment
          }
        }
      `,
      referenceEntries: {
        viewer: (data) => data == null ? void 0 : data.viewer
      },
      resolvers: {
        Viewer: () => ({
          suggestedFriends: [
            {
              id: "friend-1",
              name: {
                firstName: "Alice",
                lastName: "Johnson"
              }
            },
            {
              id: "friend-2",
              name: {
                firstName: "Bob",
                lastName: "Smith"
              }
            },
            {
              id: "friend-3",
              name: {
                firstName: "Carol",
                lastName: "Williams"
              }
            }
          ]
        })
      }
    }
  }
};
var SuggestedFriends_stories_default = meta;
var WithDefaultFriends = {
  play: (context) => __async(void 0, null, function* () {
    const container = within(context.canvasElement);
    yield container.findByText("Alice Johnson");
    yield container.findByText("Bob Smith");
    yield container.findByText("Carol Williams");
  })
};
var EmptyState = {
  parameters: {
    novaEnvironment: {
      resolvers: {
        Viewer: () => ({
          suggestedFriends: []
        })
      }
    }
  },
  play: (context) => __async(void 0, null, function* () {
    const container = within(context.canvasElement);
    yield container.findByText("No suggested friends available.");
  })
};
var WithManyFriends = {
  parameters: {
    novaEnvironment: {
      resolvers: {
        Viewer: () => ({
          suggestedFriends: Array.from({ length: 10 }, (_, i) => ({
            id: `friend-${i + 1}`,
            name: {
              firstName: `Friend${i + 1}`,
              lastName: `TestUser${i + 1}`
            }
          }))
        })
      }
    }
  },
  play: (context) => __async(void 0, null, function* () {
    const container = within(context.canvasElement);
    yield container.findByText("Friend1 TestUser1");
    yield container.findByText("Friend10 TestUser10");
    const listItems = container.getAllByRole("listitem");
    expect(listItems).toHaveLength(10);
  })
};
export {
  EmptyState,
  WithDefaultFriends,
  WithManyFriends,
  SuggestedFriends_stories_default as default
};
