@ -2,10 +2,10 @@ import { flushSync } from '../../../../src/index-client';
import { test } from '../../test' ;
export default test ( {
html : ` <button> add</button><button>delete</button><button>clear</button>` ,
html : ` <button> set if</button><button>set if 1</button><button> add</button><button>delete</button><button>clear</button><div>0:0</div >` ,
test ( { assert , target } ) {
const [ btn , btn2 , btn3 ] = target . querySelectorAll ( 'button' ) ;
const [ btn , btn2 , btn3 , btn4 , btn5 ] = target . querySelectorAll ( 'button' ) ;
flushSync ( ( ) => {
btn ? . click ( ) ;
@ -13,38 +13,56 @@ export default test({
assert . htmlEqual (
target . innerHTML ,
` <button> add</button><button>delete</button><button>clear</button><div>1 :1</div>`
` <button> set if</button><button>set if 1</button><button> add</button><button>delete</button><button>clear</button><div>0 :1</div>`
) ;
flushSync ( ( ) => {
btn ? . click ( ) ;
btn 2 ? . click ( ) ;
} ) ;
assert . htmlEqual (
target . innerHTML ,
` <button>set if</button><button>set if 1</button><button>add</button><button>delete</button><button>clear</button><div>0:0</div> `
) ;
flushSync ( ( ) => {
btn ? . click ( ) ;
btn 3 ? . click ( ) ;
} ) ;
assert . htmlEqual (
target . innerHTML ,
` <button> add</button><button>delete</button><button>clear</button><div>1:1</div><div>2:2</div><div>3:3 </div>`
` <button> set if</button><button>set if 1</button><button> add</button><button>delete</button><button>clear</button><div>0:0</div><div>2:2 </div>`
) ;
flushSync ( ( ) => {
btn2 ? . click ( ) ;
btn3 ? . click ( ) ;
} ) ;
flushSync ( ( ) => {
btn3 ? . click ( ) ;
} ) ;
assert . htmlEqual (
target . innerHTML ,
` <button> add</button><button>delete</button><button>clear</button><div>1:1</div><div>2:2 </div>`
` <button> set if</button><button>set if 1</button><button> add</button><button>delete</button><button>clear</button><div>0:0</div><div>2:2</div><div>3:3</div><div>4:4 </div>`
) ;
flushSync ( ( ) => {
btn3 ? . click ( ) ;
btn4 ? . click ( ) ;
} ) ;
assert . htmlEqual (
target . innerHTML ,
` <button>set if</button><button>set if 1</button><button>add</button><button>delete</button><button>clear</button><div>0:0</div><div>2:2</div><div>3:3</div> `
) ;
flushSync ( ( ) => {
btn5 ? . click ( ) ;
} ) ;
assert . htmlEqual (
target . innerHTML ,
` <button>add</button><button>delete</button><button>clear</button> `
` <button> set if</button><button>set if 1</button><button> add</button><button>delete</button><button>clear</button>`
) ;
}
} ) ;