composer.test.ts 865 B

1234567891011121314151617
  1. import { mount } from '@vue/test-utils'
  2. import { describe, expect, it } from 'vitest'
  3. import ComposerShell from '@/components/composer/ComposerShell.vue'
  4. describe('composer availability', () => {
  5. it('keeps the group-chat send action available while an Agent is running', () => {
  6. const wrapper = mount(ComposerShell, { props: { mode: 'group', streaming: true } })
  7. expect(wrapper.find('[aria-label="发送消息"]').exists()).toBe(true)
  8. expect(wrapper.find('[aria-label="停止生成"]').exists()).toBe(false)
  9. })
  10. it('keeps the ordinary-chat interrupt action while its server run is active', () => {
  11. const wrapper = mount(ComposerShell, { props: { mode: 'chat', streaming: true } })
  12. expect(wrapper.find('[aria-label="停止生成"]').exists()).toBe(true)
  13. expect(wrapper.find('[aria-label="发送消息"]').exists()).toBe(false)
  14. })
  15. })