Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions frontend/src/components/Config/CreateTargetDialog.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -398,16 +398,20 @@ describe("CreateTargetDialog", () => {
});
});

it("should display pyrit_conf hint text", () => {
it("should display supported target initializer guidance", () => {
render(
<TestWrapper>
<CreateTargetDialog {...defaultProps} />
</TestWrapper>
);

expect(screen.getByText("target", { selector: "code" })).toBeInTheDocument();
expect(
screen.getByText(/auto-populated by adding an initializer/)
screen.getByText(/registers available prompt targets from endpoints/i)
).toBeInTheDocument();
expect(
screen.queryByText("airt", { selector: "code" })
).not.toBeInTheDocument();
});

it("should render .pyrit_conf_example as an accessible link", () => {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/Config/CreateTargetDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -712,9 +712,9 @@ export default function CreateTargetDialog({ open, onClose, onCreated, existingT

{!isRoundRobin && (
<Label size="small" style={{ color: tokens.colorNeutralForeground3 }}>
Targets can also be auto-populated by adding an initializer (e.g. <code>airt</code>) to your{' '}
<code>~/.pyrit/.pyrit_conf</code> file, which reads endpoints from your <code>.env</code> and{' '}
<code>.env.local</code> files. See{' '}
Targets can also be auto-populated by adding the <code>target</code> initializer to your{' '}
<code>~/.pyrit/.pyrit_conf</code> file, which registers available prompt targets from endpoints in{' '}
your <code>.env</code> and <code>.env.local</code> files. See{' '}
<Link href="https://github.com/microsoft/PyRIT/blob/main/.pyrit_conf_example" target="_blank" inline>
.pyrit_conf_example
</Link>.
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/components/Config/TargetConfig.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ describe("TargetConfig", () => {
await waitFor(() => {
expect(screen.getByText("No Targets Configured")).toBeInTheDocument();
});
expect(screen.getByText("target", { selector: "code" })).toBeInTheDocument();
expect(
screen.getByText(/register available prompt targets automatically/i)
).toBeInTheDocument();
expect(
screen.queryByText("airt", { selector: "code" })
).not.toBeInTheDocument();
});

it(
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Config/TargetConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ export default function TargetConfig({ activeTarget, onSetActiveTarget }: Target
<Text size={300} style={{ color: tokens.colorNeutralForeground3 }}>
Add a target manually, or configure an initializer in your <code>~/.pyrit/.pyrit_conf</code> file
to auto-populate targets from your <code>.env</code> and <code>.env.local</code> files.
For example, add <code>airt</code> to the <code>initializers</code> list to register
Azure OpenAI targets automatically. See the{' '}
For example, add <code>target</code> to the <code>initializers</code> list to register
available prompt targets automatically. See the{' '}
<Link href="https://github.com/microsoft/PyRIT/blob/main/.pyrit_conf_example" target="_blank" inline>
.pyrit_conf_example
</Link>{' '}
Expand Down