File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,11 @@ import CompDefault from './fixtures/Comp.html'
8
8
describe ( 'render' , ( ) => {
9
9
let props
10
10
11
- const render = ( ) => {
11
+ const render = ( additional = { } ) => {
12
12
return stlRender ( Comp , {
13
13
target : document . body ,
14
- props
14
+ props,
15
+ ...additional
15
16
} )
16
17
}
17
18
@@ -40,6 +41,21 @@ describe('render', () => {
40
41
expect ( getByText ( 'Hello Worlds!' ) ) . toBeInTheDocument ( )
41
42
} )
42
43
44
+ test ( 'change props with accessors' , async ( ) => {
45
+ const { component, getByText } = render ( { accessors : true } ) ;
46
+
47
+ expect ( getByText ( 'Hello World!' ) ) . toBeInTheDocument ( )
48
+
49
+ expect ( component . name ) . toBe ( 'World' ) ;
50
+
51
+
52
+ await act ( ( ) => {
53
+ component . value = 'Planet'
54
+ } )
55
+
56
+ expect ( getByText ( 'Hello World!' ) ) . toBeInTheDocument ( )
57
+ } )
58
+
43
59
test ( 'should accept props directly' , ( ) => {
44
60
const { getByText } = stlRender ( Comp , { name : 'World' } )
45
61
expect ( getByText ( 'Hello World!' ) ) . toBeInTheDocument ( )
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ const containerCache = new Map()
5
5
const componentCache = new Set ( )
6
6
7
7
const svelteComponentOptions = [
8
+ 'accessors' ,
8
9
'anchor' ,
9
10
'props' ,
10
11
'hydrate' ,
You can’t perform that action at this time.
0 commit comments