-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): make package endpoints links (#136)
- Loading branch information
1 parent
2907c75
commit 572f385
Showing
3 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
ui/src/lib/features/k8s/configs/uds-packages/links/component.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script lang="ts"> | ||
export let endpoints: string[] | ||
</script> | ||
|
||
{#each endpoints as endpoint} | ||
<a | ||
href={`https://${endpoint}`} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
on:click|stopPropagation | ||
class="font-medium text-blue-600 dark:text-blue-500 hover:underline pr-4">{endpoint}</a | ||
> | ||
{/each} |
14 changes: 14 additions & 0 deletions
14
ui/src/lib/features/k8s/configs/uds-packages/links/component.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { render } from '@testing-library/svelte' | ||
|
||
import EndpointLinks from './component.svelte' | ||
|
||
describe('ExemptionElement', () => { | ||
test('renders exemption title', () => { | ||
const endpoints = ['grafana', 'keycloak'] | ||
const { getAllByRole } = render(EndpointLinks, { props: { endpoints } }) | ||
const links = getAllByRole('link') | ||
expect(links).toHaveLength(2) | ||
expect(links[0]).toHaveTextContent('grafana') | ||
expect(links[1]).toHaveTextContent('keycloak') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters