Skip to content
Merged
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
15 changes: 15 additions & 0 deletions frontend/src/components/Config/CreateTargetDialog.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,21 @@ describe("CreateTargetDialog", () => {
).toBeInTheDocument();
});

it("should render .pyrit_conf_example as an accessible link", () => {
render(
<TestWrapper>
<CreateTargetDialog {...defaultProps} />
</TestWrapper>
);

const link = screen.getByRole("link", { name: ".pyrit_conf_example" });
expect(link).toBeInTheDocument();
expect(link).toHaveAttribute(
"href",
"https://github.com/microsoft/PyRIT/blob/main/.pyrit_conf_example"
);
});

it("should show field validation errors when submitting form without endpoint", async () => {
const user = userEvent.setup();

Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/Config/CreateTargetDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Button,
Input,
Label,
Link,
Radio,
RadioGroup,
Select,
Expand Down Expand Up @@ -348,9 +349,9 @@ export default function CreateTargetDialog({ open, onClose, onCreated }: CreateT
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{' '}
<a href="https://github.com/microsoft/PyRIT/blob/main/.pyrit_conf_example" target="_blank" rel="noopener noreferrer">
<Link href="https://github.com/microsoft/PyRIT/blob/main/.pyrit_conf_example" target="_blank" inline>
.pyrit_conf_example
</a>.
</Link>.
</Label>
</form>
</DialogContent>
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/Config/TargetConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
tokens,
Text,
Button,
Link,
Spinner,
} from '@fluentui/react-components'
import { AddRegular, ArrowSyncRegular } from '@fluentui/react-icons'
Expand Down Expand Up @@ -107,9 +108,9 @@ export default function TargetConfig({ activeTarget, onSetActiveTarget }: Target
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{' '}
<a href="https://github.com/microsoft/PyRIT/blob/main/.pyrit_conf_example" target="_blank" rel="noopener noreferrer">
<Link href="https://github.com/microsoft/PyRIT/blob/main/.pyrit_conf_example" target="_blank" inline>
.pyrit_conf_example
</a>{' '}
</Link>{' '}
for details.
</Text>
<Button
Expand Down
Loading