test(14.2.1-06): land remaining named tests and phase gate

WR-02 proofs and T-14.2.1-19..23 must fail the phase closed if hydration or child locale validation is removed.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jakub Zych
2026-10-06 16:28:29 +02:00
parent 4e37d877f1
commit ef03016314
4 changed files with 86 additions and 10 deletions

View File

@@ -61,6 +61,35 @@ describe('ML field registry and nested save body', () => {
})
})
it('sends every enabled locale including empty pl', () => {
const fields = [field('mltext'), field('mlmarkdown', 'body')]
const payload = editablePayload(fields, {
title: { en: 'Hello', pl: '' },
body: { en: '# Hi', pl: '' },
})
expect(payload).toEqual({
title: { en: 'Hello', pl: '' },
body: { en: '# Hi', pl: '' },
})
})
it('exposes one locale selector per ML field listing enabled locales', () => {
const title = mlMount(MLTextField, {
field: field('mltext'),
modelValue: { en: '', pl: '' },
controlId: 'f-title',
})
const body = mlMount(MLMarkdownField, {
field: field('mlmarkdown', 'body'),
modelValue: { en: '', pl: '' },
controlId: 'f-body',
})
expect(title.findAll('[data-ml-locale]')).toHaveLength(1)
expect(body.findAll('[data-ml-locale]')).toHaveLength(1)
expect(title.findAll('[data-ml-locale] option').map((node) => node.text())).toEqual(['en', 'pl'])
expect(body.findAll('[data-ml-locale] option').map((node) => node.text())).toEqual(['en', 'pl'])
})
it('edits the active locale and copies from another', async () => {
const wrapper = mlMount(MLTextField, {
field: field('mltext'),

View File

@@ -1,8 +1,10 @@
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
import { enableAutoUnmount, mount } from '@vue/test-utils'
import { ref } from 'vue'
import type { FormField } from '../../src/api/types'
import MarkdownField from '../../src/components/form/fields/MarkdownField.vue'
import MLMarkdownField from '../../src/components/form/fields/MLMarkdownField.vue'
import { FORM_ENABLED_LOCALES } from '../../src/components/form/formContext'
import { resetState } from '../helpers'
function field(type = 'markdown', name = 'body'): FormField {
@@ -64,6 +66,11 @@ describe('MarkdownField composition and sinks', () => {
controlId: 'f-body',
},
attachTo: document.body,
global: {
provide: {
[FORM_ENABLED_LOCALES as symbol]: ref(['en', 'pl']),
},
},
})
expect(wrapper.findComponent(MarkdownField).exists()).toBe(true)
await wrapper.find('[data-ml-locale]').setValue('pl')