Chat.userMessageWhitespace.test.js 557 B

1234567891011121314
  1. import { readFileSync } from 'node:fs'
  2. import { dirname, resolve } from 'node:path'
  3. import { fileURLToPath } from 'node:url'
  4. import { describe, expect, it } from 'vitest'
  5. const __filename = fileURLToPath(import.meta.url)
  6. const __dirname = dirname(__filename)
  7. const chatSource = readFileSync(resolve(__dirname, 'Chat.vue'), 'utf8')
  8. describe('Chat user message whitespace', () => {
  9. it('preserves line breaks in sent user messages', () => {
  10. expect(chatSource).toMatch(/\.user-message[\s\S]*?\.message-text\s*\{[\s\S]*?white-space:\s*pre-wrap/)
  11. })
  12. })