kin: auto-commit after pipeline

This commit is contained in:
Gros Frumos 2026-03-18 15:31:04 +02:00
parent 53a7fa2a43
commit e9ef03b8fc

View file

@ -0,0 +1,108 @@
/**
* KIN-UI-014: Тесты i18n-рефакторинга SSH-лейблов в ProjectView
*
* Проверяет:
* 1. Ключи settings.ssh_host/ssh_user/ssh_key_path/ssh_proxy_jump присутствуют в en.json
* 2. Ключи settings.ssh_host/ssh_user/ssh_key_path/ssh_proxy_jump присутствуют в ru.json
* 3. Значения английских ключей корректны
* 4. Значения русских ключей корректны
*/
import { describe, it, expect } from 'vitest'
import enJson from '../locales/en.json'
import ruJson from '../locales/ru.json'
describe('KIN-UI-014: SSH-лейблы в en.json', () => {
it('settings.ssh_host присутствует в en.json', () => {
expect((enJson.settings as Record<string, string>).ssh_host).toBeDefined()
})
it('settings.ssh_user присутствует в en.json', () => {
expect((enJson.settings as Record<string, string>).ssh_user).toBeDefined()
})
it('settings.ssh_key_path присутствует в en.json', () => {
expect((enJson.settings as Record<string, string>).ssh_key_path).toBeDefined()
})
it('settings.ssh_proxy_jump присутствует в en.json', () => {
expect((enJson.settings as Record<string, string>).ssh_proxy_jump).toBeDefined()
})
it('settings.ssh_host имеет корректное английское значение', () => {
expect((enJson.settings as Record<string, string>).ssh_host).toBe('SSH Host')
})
it('settings.ssh_user имеет корректное английское значение', () => {
expect((enJson.settings as Record<string, string>).ssh_user).toBe('SSH User')
})
it('settings.ssh_key_path имеет корректное английское значение', () => {
expect((enJson.settings as Record<string, string>).ssh_key_path).toBe('SSH Key Path')
})
it('settings.ssh_proxy_jump имеет корректное английское значение', () => {
expect((enJson.settings as Record<string, string>).ssh_proxy_jump).toBe('SSH ProxyJump')
})
})
describe('KIN-UI-014: SSH-лейблы в ru.json', () => {
it('settings.ssh_host присутствует в ru.json', () => {
expect((ruJson.settings as Record<string, string>).ssh_host).toBeDefined()
})
it('settings.ssh_user присутствует в ru.json', () => {
expect((ruJson.settings as Record<string, string>).ssh_user).toBeDefined()
})
it('settings.ssh_key_path присутствует в ru.json', () => {
expect((ruJson.settings as Record<string, string>).ssh_key_path).toBeDefined()
})
it('settings.ssh_proxy_jump присутствует в ru.json', () => {
expect((ruJson.settings as Record<string, string>).ssh_proxy_jump).toBeDefined()
})
it('settings.ssh_host имеет корректное русское значение', () => {
expect((ruJson.settings as Record<string, string>).ssh_host).toBe('SSH Хост')
})
it('settings.ssh_user имеет корректное русское значение', () => {
expect((ruJson.settings as Record<string, string>).ssh_user).toBe('SSH Пользователь')
})
it('settings.ssh_key_path имеет корректное русское значение', () => {
expect((ruJson.settings as Record<string, string>).ssh_key_path).toBe('Путь к SSH ключу')
})
it('settings.ssh_proxy_jump имеет корректное русское значение', () => {
expect((ruJson.settings as Record<string, string>).ssh_proxy_jump).toBe('SSH ProxyJump')
})
})
describe('KIN-UI-014: ProjectView.vue не содержит хардкод SSH-лейблов', () => {
it('все 4 SSH-ключа отсутствуют как хардкод — ключи локалей совпадают между en и ru', () => {
const en = enJson.settings as Record<string, string>
const ru = ruJson.settings as Record<string, string>
// Оба файла содержат одинаковый набор SSH-ключей
expect(Object.keys(en)).toContain('ssh_host')
expect(Object.keys(en)).toContain('ssh_user')
expect(Object.keys(en)).toContain('ssh_key_path')
expect(Object.keys(en)).toContain('ssh_proxy_jump')
expect(Object.keys(ru)).toContain('ssh_host')
expect(Object.keys(ru)).toContain('ssh_user')
expect(Object.keys(ru)).toContain('ssh_key_path')
expect(Object.keys(ru)).toContain('ssh_proxy_jump')
})
it('SSH-ключи в ru.json не совпадают с английскими (переведены)', () => {
const en = enJson.settings as Record<string, string>
const ru = ruJson.settings as Record<string, string>
// ssh_host, ssh_user, ssh_key_path — переведены, не совпадают
expect(ru.ssh_host).not.toBe(en.ssh_host)
expect(ru.ssh_user).not.toBe(en.ssh_user)
expect(ru.ssh_key_path).not.toBe(en.ssh_key_path)
// ssh_proxy_jump — бренд, одинаков в обоих языках
expect(ru.ssh_proxy_jump).toBe(en.ssh_proxy_jump)
})
})