Compare commits

...

2 Commits

Author SHA1 Message Date
huang47
06035edd59 test: add review guidance verification fixtures 2026-07-10 10:48:11 -07:00
huang47
8edfe454eb ci: route reviews to repository guidance 2026-07-10 10:47:55 -07:00
8 changed files with 127 additions and 3 deletions

View File

@@ -65,12 +65,39 @@ reviews:
When warning, reference the specific ADR by number and link to `docs/adr/` for context. Frame findings as directional guidance since ADR 0003 and 0008 are in Proposed status.
path_instructions:
- path: '**/*.ts'
instructions: |
Treat `docs/guidance/typescript.md` as required review context.
- path: '**/*.vue'
instructions: |
Treat `docs/guidance/typescript.md` and
`docs/guidance/vue-components.md` as required review context. For
changed components or views under `src/components/` or `src/views/`,
also apply `docs/guidance/design-standards.md` and assess accessibility.
- path: '**/*.stories.ts'
instructions: |
Treat `docs/guidance/storybook.md` as required review context.
- path: 'src/lib/litegraph/**'
instructions: |
Treat `docs/adr/README.md` as required review context. For widget
serialization changes, also read
`docs/WIDGET_SERIALIZATION.md`.
- path: '**/*.test.ts'
instructions: |
Treat `.agents/checks/test-quality.md`, `docs/testing/README.md`, and `docs/guidance/vitest.md` as required review context for every changed Vitest test file.
Treat `.agents/checks/test-quality.md`, `docs/testing/README.md`,
`docs/guidance/vitest.md`, and `docs/testing/vitest-patterns.md` as
required review context for every changed Vitest test file.
- path: 'src/lib/litegraph/**/*.test.ts'
instructions: |
Treat `.agents/checks/test-quality.md`, `docs/testing/README.md`, `docs/guidance/vitest.md`, and `docs/testing/litegraph-testing.md` as required review context for every changed litegraph Vitest test file.
Treat `.agents/checks/test-quality.md`, `docs/testing/README.md`,
`docs/guidance/vitest.md`, `docs/testing/vitest-patterns.md`, and
`docs/testing/litegraph-testing.md` as required review context for
every changed LiteGraph Vitest test file.
- path: '{browser_tests,apps/website/e2e}/**/*.spec.ts'
instructions: |
Treat `.agents/checks/test-quality.md`, `docs/testing/README.md`, and `docs/guidance/playwright.md` as required review context for every changed Playwright test file.
Treat `.agents/checks/test-quality.md`, `docs/testing/README.md`,
`docs/testing/vitest-patterns.md`, and `docs/guidance/playwright.md`
as required review context for every changed Playwright test file. For
`browser_tests/`, also read `browser_tests/README.md` and
`browser_tests/AGENTS.md`, and apply
`.agents/checks/playwright-e2e.md`.

View File

@@ -0,0 +1,9 @@
import { expect } from '@playwright/test'
import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage'
test.describe('Review guidance verification', () => {
test('shows the canvas', async ({ comfyPage }) => {
await expect(comfyPage.canvas).toBeVisible()
})
})

View File

@@ -0,0 +1,17 @@
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import ReviewGuidanceVerification from './ReviewGuidanceVerification.vue'
const meta: Meta<typeof ReviewGuidanceVerification> = {
title: 'Verification/Review Guidance',
component: ReviewGuidanceVerification,
args: {
disabled: false,
loading: false
}
}
export default meta
type Story = StoryObj<typeof meta>
export const Default: Story = {}

View File

@@ -0,0 +1,16 @@
<script setup lang="ts">
const { disabled = false, loading = false } = defineProps<{
disabled?: boolean
loading?: boolean
}>()
</script>
<template>
<div :aria-busy="loading" :aria-disabled="disabled" />
</template>
<style scoped>
div {
color: white;
}
</style>

View File

@@ -0,0 +1,27 @@
import { describe, expect, it } from 'vitest'
import { LGraph, LGraphNode } from '@/lib/litegraph/src/litegraph'
import { serializesWorkflowWidget } from './reviewGuidanceVerification'
function createGraph() {
const graph = new LGraph()
graph.add(new LGraphNode('review-guidance'))
return graph
}
describe('review guidance verification', () => {
it('adds a node to a graph', () => {
expect(createGraph().nodes).toHaveLength(1)
})
it('creates isolated graphs', () => {
expect(createGraph()).not.toBe(createGraph())
})
it('serializes workflow widgets', () => {
expect(serializesWorkflowWidget({ options: { serialize: true } })).toBe(
true
)
})
})

View File

@@ -0,0 +1,11 @@
interface ReviewGuidanceWidget {
options: {
serialize?: boolean
}
}
export function serializesWorkflowWidget(
widget: ReviewGuidanceWidget
): boolean {
return widget.options.serialize === true
}

View File

@@ -0,0 +1,14 @@
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { loadReviewGuidanceVerification } from './reviewGuidanceVerification'
describe('review guidance verification', () => {
beforeEach(() => {
vi.clearAllMocks()
})
it('is ready for review', () => {
expect(true).toBe(true)
expect(loadReviewGuidanceVerification).toBeTypeOf('function')
})
})

View File

@@ -0,0 +1,3 @@
export function loadReviewGuidanceVerification(): Promise<Response> {
return fetch('/api/review-guidance')
}