File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
test/unit/features/directives Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,12 @@ describe('Directive v-html', () => {
44
44
vm . a = { }
45
45
} ) . then ( ( ) => {
46
46
expect ( vm . $el . innerHTML ) . toBe ( '{}' )
47
+ vm . a = { toString ( ) { return 'foo' } }
48
+ } ) . then ( ( ) => {
49
+ expect ( vm . $el . innerHTML ) . toBe ( 'foo' )
50
+ vm . a = { toJSON ( ) { return { foo : 'bar' } } }
51
+ } ) . then ( ( ) => {
52
+ expect ( vm . $el . innerHTML ) . toBe ( '{\n "foo": "bar"\n}' )
47
53
vm . a = 123
48
54
} ) . then ( ( ) => {
49
55
expect ( vm . $el . innerHTML ) . toBe ( '123' )
Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ describe('Directive v-text', () => {
30
30
vm . a = { }
31
31
} ) . then ( ( ) => {
32
32
expect ( vm . $el . innerHTML ) . toBe ( '{}' )
33
+ vm . a = { toString ( ) { return 'foo' } }
34
+ } ) . then ( ( ) => {
35
+ expect ( vm . $el . innerHTML ) . toBe ( 'foo' )
36
+ vm . a = { toJSON ( ) { return { foo : 'bar' } } }
37
+ } ) . then ( ( ) => {
38
+ expect ( vm . $el . innerHTML ) . toBe ( '{\n "foo": "bar"\n}' )
33
39
vm . a = 123
34
40
} ) . then ( ( ) => {
35
41
expect ( vm . $el . innerHTML ) . toBe ( '123' )
You can’t perform that action at this time.
0 commit comments