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
13 changes: 13 additions & 0 deletions plugins/code-server/app/components/LauncherView.stories.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import type { CodeServerDetection } from '../connect'
import { expect, within } from 'storybook/test'
import LauncherView from './LauncherView.vue'

const localCodeServer: CodeServerDetection = {
Expand Down Expand Up @@ -44,6 +45,18 @@ export const NotInstalled: Story = {
server: { status: 'stopped' },
busy: false,
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement)
const docsLink = canvas.getByRole('link', { name: 'Installation docs' })
const repoLink = canvas.getByRole('link', { name: 'GitHub' })

await expect(docsLink).toHaveAttribute('href', 'https://coder.com/docs/code-server/latest/install')
await expect(docsLink).toHaveAttribute('target', '_blank')
await expect(docsLink).toHaveAttribute('rel', 'noreferrer')
await expect(repoLink).toHaveAttribute('href', 'https://github.com/coder/code-server')
await expect(repoLink).toHaveAttribute('target', '_blank')
await expect(repoLink).toHaveAttribute('rel', 'noreferrer')
},
}

/** Short dock panel with install instructions available through scrolling. */
Expand Down
18 changes: 16 additions & 2 deletions plugins/code-server/app/components/LauncherView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,24 @@ const errorText = computed(() => (props.server.status === 'error' ? props.server
>
{{ busy ? 'Checking…' : 'Re-check' }}
</ActionButton>
<ActionButton variant="text" size="sm" :href="DOCS_URL" icon="i-ph-arrow-square-out">
<ActionButton
variant="text"
size="sm"
:href="DOCS_URL"
target="_blank"
rel="noreferrer"
icon="i-ph-arrow-square-out"
>
Installation docs
</ActionButton>
<ActionButton variant="text" size="sm" :href="REPO_URL" icon="i-ph-github-logo">
<ActionButton
variant="text"
size="sm"
:href="REPO_URL"
target="_blank"
rel="noreferrer"
icon="i-ph-github-logo"
>
GitHub
</ActionButton>
</div>
Expand Down
Loading