@@ -3,24 +3,33 @@ import { getElement } from "../utils.js";
33
44test ( "partial target" , ( t ) => {
55 const html =
6- "<button unicorn:click='test_click' unicorn:partial='test-id '>Click</button>" ;
6+ "<button unicorn:click='test_click' unicorn:partial='test-target '>Click</button>" ;
77 const element = getElement ( html ) ;
88
9- t . is ( element . partial . target , "test-id " ) ;
9+ t . is ( element . partials [ 0 ] . target , "test-target " ) ;
1010} ) ;
1111
1212test ( "partial.id" , ( t ) => {
1313 const html =
1414 "<button unicorn:click='test_click' unicorn:partial.id='test-id'>Click</button>" ;
1515 const element = getElement ( html ) ;
1616
17- t . is ( element . partial . id , "test-id" ) ;
17+ t . is ( element . partials [ 0 ] . id , "test-id" ) ;
1818} ) ;
1919
2020test ( "partial.key" , ( t ) => {
2121 const html =
22- "<button unicorn:click='test_click' unicorn:partial.key='test-id '>Click</button>" ;
22+ "<button unicorn:click='test_click' unicorn:partial.key='test-key '>Click</button>" ;
2323 const element = getElement ( html ) ;
2424
25- t . is ( element . partial . key , "test-id" ) ;
25+ t . is ( element . partials [ 0 ] . key , "test-key" ) ;
26+ } ) ;
27+
28+ test ( "multiple partials" , ( t ) => {
29+ const html =
30+ "<button unicorn:click='test_click' unicorn:partial.id='test-id' unicorn:partial.key='test-key'>Click</button>" ;
31+ const element = getElement ( html ) ;
32+
33+ t . is ( element . partials [ 0 ] . id , "test-id" ) ;
34+ t . is ( element . partials [ 1 ] . key , "test-key" ) ;
2635} ) ;
0 commit comments