diff --git a/frontend/src/components/chat/FollowUpSuggestions.test.ts b/frontend/src/components/chat/FollowUpSuggestions.test.ts new file mode 100644 index 00000000..6d694a7c --- /dev/null +++ b/frontend/src/components/chat/FollowUpSuggestions.test.ts @@ -0,0 +1,25 @@ +import assert from 'node:assert/strict' +import test from 'node:test' +import { readFileSync } from 'node:fs' + +const component = readFileSync(new URL('./FollowUpSuggestions.vue', import.meta.url), 'utf8') + +test('does not insert a separate status row while the first suggestions are loading', () => { + assert.match(component, //) + assert.match(component, /v-if="suggestionSet\?\.status === 'ready'"/) + assert.doesNotMatch(component, /follow-ups-loading/) + assert.doesNotMatch(component, /follow-ups__skeletons/) +}) + +test('keeps the existing follow-up card visible while regenerating', () => { + assert.match(component, /:disabled="loading"/) + assert.match(component, /loading \? 'loading' : 'refresh'/) + assert.match(component, /class="follow-ups__list"/) +}) + +test('carries the lightbulb into the expanding question card', () => { + assert.match(component, /class="follow-ups__title"/) + assert.match(component, /name="lightbulb"/) + assert.match(component, /\.follow-up-card-enter-from/) + assert.match(component, /clip-path: inset\(0 0 55%/) +}) diff --git a/frontend/src/components/chat/FollowUpSuggestions.vue b/frontend/src/components/chat/FollowUpSuggestions.vue index b1ea36fa..707f1a6e 100644 --- a/frontend/src/components/chat/FollowUpSuggestions.vue +++ b/frontend/src/components/chat/FollowUpSuggestions.vue @@ -1,28 +1,30 @@