Skip to content

Commit cd0c762

Browse files
committed
rollup test cases
1 parent 35030b9 commit cd0c762

File tree

4 files changed

+14
-30
lines changed

4 files changed

+14
-30
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`slot reactivity > composable > en 1`] = `"<h1>Root</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>hello!</p><div class="child"><h1>Child</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>hello!</p><div class="sub-child"><h1>Sub Child</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>hello!</p></div> t inside of slot <p>hello!</p> i18n-t inside of slot <p>hello!</p></div>"`;
3+
exports[`slot reactivity > en 1`] = `"<h1>Root</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>hello!</p><div class="child"><h1>Child</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>hello!</p><div class="sub-child"><h1>Sub Child</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>hello!</p></div> t inside of slot <p>hello!</p> i18n-t inside of slot <p>hello!</p></div>"`;
44

5-
exports[`slot reactivity > composable > ja 1`] = `"<h1>Root</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>こんにちは!</p><div class="child"><h1>Child</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>こんにちは!</p><div class="sub-child"><h1>Sub Child</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>こんにちは!</p></div> t inside of slot <p>こんにちは!</p> i18n-t inside of slot <p>こんにちは!</p></div>"`;
6-
7-
exports[`slot reactivity > legacy > en 1`] = `"<h1>Root</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>hello!</p><div class="child"><h1>Child</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>hello!</p><div class="sub-child"><h1>Sub Child</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>hello!</p></div> $t inside of slot <p>hello!</p> i18n-t inside of slot <p>hello!</p></div>"`;
8-
9-
exports[`slot reactivity > legacy > ja 1`] = `"<h1>Root</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>こんにちは!</p><div class="child"><h1>Child</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>こんにちは!</p><div class="sub-child"><h1>Sub Child</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>こんにちは!</p></div> $t inside of slot <p>こんにちは!</p> i18n-t inside of slot <p>こんにちは!</p></div>"`;
5+
exports[`slot reactivity > ja 1`] = `"<h1>Root</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>こんにちは!</p><div class="child"><h1>Child</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>こんにちは!</p><div class="sub-child"><h1>Sub Child</h1><form><select><option value="en">en</option><option value="ja">ja</option></select></form><p>こんにちは!</p></div> t inside of slot <p>こんにちは!</p> i18n-t inside of slot <p>こんにちは!</p></div>"`;

packages/vue-i18n-core/test/i18n.test.ts

+9-21
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ afterEach(() => {
5858
setDevToolsHook(null)
5959
})
6060

61-
describe('createI18n with flat json messages', () => {
62-
test('composition mode', () => {
61+
test('createI18n with flat json messages', () => {
6362
const i18n = createI18n({
6463
flatJson: true,
6564
messages: {
@@ -70,7 +69,6 @@ describe('createI18n with flat json messages', () => {
7069
// @ts-ignore
7170
expect(messages.en.mainMenu.buttonStart).toEqual('Start!')
7271
})
73-
})
7472

7573
describe('useI18n', () => {
7674
let org: any // eslint-disable-line @typescript-eslint/no-explicit-any
@@ -348,7 +346,7 @@ describe('useI18n', () => {
348346
})
349347
})
350348

351-
describe('slot reactivity', () => {
349+
test('slot reactivity', async () => {
352350
let org: any // eslint-disable-line @typescript-eslint/no-explicit-any
353351
let spy: any // eslint-disable-line @typescript-eslint/no-explicit-any
354352
beforeEach(() => {
@@ -360,7 +358,6 @@ describe('slot reactivity', () => {
360358
console.warn = org
361359
})
362360

363-
test('composable', async () => {
364361
const i18n = createI18n({
365362
locale: 'ja',
366363
fallbackLocale: ['en'],
@@ -452,7 +449,6 @@ describe('slot reactivity', () => {
452449
await nextTick()
453450
expect(html()).toMatchSnapshot('en')
454451
})
455-
})
456452

457453
test('multi instance', async () => {
458454
const i18n1 = createI18n({
@@ -567,8 +563,7 @@ test('merge useI18n resources to global scope', async () => {
567563
})
568564
})
569565

570-
describe('merge i18n custom blocks to global scope', () => {
571-
test('composition mode', async () => {
566+
test('merge i18n custom blocks to global scope', async () => {
572567
const i18n = createI18n({
573568
locale: 'ja',
574569
messages: {
@@ -624,14 +619,13 @@ describe('merge i18n custom blocks to global scope', () => {
624619
foo: 'ふー!'
625620
})
626621
})
627-
})
628622

629623
describe('custom pluralization', () => {
630624
const mockWarn = vi.spyOn(shared, 'warnOnce')
631625
// eslint-disable-next-line @typescript-eslint/no-empty-function
632626
mockWarn.mockImplementation(() => {})
633627

634-
test('composition', async () => {
628+
test('pluralization', async () => {
635629
const i18n = createI18n({
636630
locale: 'ru',
637631
pluralRules: _pluralRules,
@@ -664,7 +658,7 @@ describe('custom pluralization', () => {
664658
expect(find('p:nth-child(5)')!.innerHTML).toEqual('21 машина')
665659
})
666660

667-
test('composition + custom block', async () => {
661+
test('custom block', async () => {
668662
const i18n = createI18n({
669663
locale: 'ru'
670664
})
@@ -765,13 +759,10 @@ describe('release global scope', () => {
765759
})
766760
})
767761

768-
describe('Composer & VueI18n extend hooking', () => {
769-
test('composition', async () => {
762+
test('Composer & VueI18n extend hooking', async () => {
770763
const composerDisposeSpy = vi.fn()
771764
let counter = 0
772-
const composerExtendSpy = vi
773-
.fn()
774-
.mockImplementation((composer: Composer) => {
765+
const composerExtendSpy = vi.fn().mockImplementation((composer: Composer) => {
775766
// eslint-disable-next-line @typescript-eslint/no-explicit-any
776767
counter += 1
777768
;(composer as any).foo = ref(`foo${counter}`)
@@ -836,9 +827,8 @@ describe('Composer & VueI18n extend hooking', () => {
836827
app.unmount()
837828
expect(composerDisposeSpy).toHaveBeenCalledTimes(2)
838829
})
839-
})
840830

841-
describe('dollar prefixed API (component injections)', () => {
831+
test('dollar prefixed API (component injections)', async () => {
842832
const mockWarn = vi.spyOn(shared, 'warn')
843833
// eslint-disable-next-line @typescript-eslint/no-empty-function
844834
mockWarn.mockImplementation(() => {})
@@ -858,7 +848,6 @@ describe('dollar prefixed API (component injections)', () => {
858848
}
859849
}
860850

861-
test('composition mode', async () => {
862851
const i18n = createI18n({
863852
locale: 'en',
864853
messages
@@ -892,9 +881,8 @@ describe('dollar prefixed API (component injections)', () => {
892881
'<div><p>hello world!</p><p>hello, world!</p><p>hello, world!</p><p>no apples</p><p>りんご1個</p><p>default message</p><p>default msg</p><p>4 apples</p><p>default list msg</p><p>こんにちは、世界!</p><p>many apples</p><p>default named msg</p><p>こんにちは、世界!</p><p>hello world!</p><p>こんにちは、世界!</p></div>'
893882
)
894883
})
895-
})
896884

897-
test('`t` on Composition API mode', async () => {
885+
test('`t`', async () => {
898886
const messages = {
899887
en: {
900888
hello: 'hello world!',

packages/vue-i18n-core/test/issues.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const numberFormats: IntlNumberFormats = {
132132
}
133133

134134
describe('issue #722', () => {
135-
test('composition', async () => {
135+
test('issue #722', async () => {
136136
const messages = {
137137
en: { language: 'English' },
138138
ja: { language: '日本語' }
@@ -169,7 +169,7 @@ describe('issue #722', () => {
169169
expect(wrapper.html()).toEqual(`<p>Hello <b>world!</b></p>`)
170170
})
171171

172-
test('v-if: composition', async () => {
172+
test('v-if', async () => {
173173
const messages = {
174174
en: { language: 'English' },
175175
ja: { language: '日本語' }

packages/vue-i18n-core/test/ssr.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ beforeAll(() => {
2626
registerLocaleFallbacker(fallbackWithLocaleChain)
2727
})
2828

29-
test('composition mode', async () => {
29+
test('ssr', async () => {
3030
const i18n = createI18n({
3131
locale: 'en',
3232
messages: {}

0 commit comments

Comments
 (0)