File tree Expand file tree Collapse file tree 3 files changed +25
-27
lines changed
Filter options
Expand file tree Collapse file tree 3 files changed +25
-27
lines changed
Original file line number Diff line number Diff line change @@ -83,24 +83,23 @@ describe('component html support', () => {
83
83
expect ( mounted . html ( ) ) . toMatchInlineSnapshot ( '"<span>Hello \u{2068}John\u{2069}<br>How are you?</span>"' )
84
84
} )
85
85
86
- it ( 'warn about not support markup' , ( ) => {
86
+ it ( 'warn about not supported markup' , ( ) => {
87
87
// Arrange
88
88
const bundle = new FluentBundle ( 'en-US' )
89
89
bundle . addResource (
90
90
new FluentResource ( ftl `
91
- key = Hello {$name}<br>How are you?<!-- this is a comment -->
91
+ key = Hello {$name}<br>How are you?
92
92
` ) ,
93
93
)
94
94
95
95
const fluent = createFluentVue ( {
96
96
bundles : [ bundle ] ,
97
97
parseMarkup : ( markup : string ) => {
98
- const window = new Window ( )
99
- const parser = new window . DOMParser ( )
100
- const doc = parser . parseFromString ( markup , 'text/html' )
101
- const nodes = Array . from ( doc . body . childNodes )
102
-
103
- return nodes
98
+ return [ {
99
+ nodeType : 8 ,
100
+ textContent : markup ,
101
+ nodeValue : markup ,
102
+ } ]
104
103
} ,
105
104
} )
106
105
@@ -120,7 +119,7 @@ describe('component html support', () => {
120
119
const mounted = mountWithFluent ( fluent , component )
121
120
122
121
// Assert
123
- expect ( mounted . html ( ) ) . toMatchInlineSnapshot ( '"<span>Hello \u{2068}John\u{2069}<br>How are you? </span>"' )
122
+ expect ( mounted . html ( ) ) . toMatchInlineSnapshot ( '"<span></span>"' )
124
123
expect ( warn ) . toHaveBeenCalledWith ( '[fluent-vue] Unsupported node type: 8. If you need support for it, please, create an issue in fluent-vue repository.' )
125
124
126
125
// Cleanup
Original file line number Diff line number Diff line change 84
84
"esbuild-plugin-globals" : " ^0.2.0" ,
85
85
"eslint" : " ^9.18.0" ,
86
86
"execa" : " ^9.3.1" ,
87
- "happy-dom" : " ^15.6.0 " ,
87
+ "happy-dom" : " ^16.7.2 " ,
88
88
"husky" : " ^9.1.5" ,
89
89
"lint-staged" : " ^15.2.9" ,
90
90
"release-it" : " *" ,
You can’t perform that action at this time.
0 commit comments