1
1
import { assert , expect } from "chai" ;
2
- import { createNode as u , patch , VNode } from "../../src" ;
2
+ import { h , patch , VNode } from "../../src" ;
3
3
4
4
import { pageTest } from "./mocks" ;
5
5
6
6
describe ( "Page" , ( ) => {
7
7
let nodes : VNode < any > ;
8
8
before ( ( ) => {
9
- const node = u ( "div" , { } ) ;
9
+ const node = h ( "div" , { } ) ;
10
10
const elm = document . createElement ( "div" ) ;
11
11
elm . setAttribute ( "id" , "app" ) ;
12
12
document . body . appendChild ( elm ) ;
13
13
patch ( node , document . getElementById ( "app" ) ) ;
14
- nodes = u ( pageTest . view , pageTest . state ) ;
14
+ nodes = h ( pageTest . view , pageTest . state ) ;
15
15
} ) ;
16
16
17
17
it ( "has to be created" , ( ) => {
@@ -22,7 +22,7 @@ describe("Page", () => {
22
22
it ( "has to change the title" , ( ) => {
23
23
const button : any = nodes . children . find ( ( node : any ) => node . nodeName === "button" ) ;
24
24
button . attributes . onclick ( ) ;
25
- nodes = u ( pageTest . view , pageTest . state ) ;
25
+ nodes = h ( pageTest . view , pageTest . state ) ;
26
26
const title : any = nodes . children . find ( ( node : any ) => node . nodeName === "h1" ) ;
27
27
expect ( title . children [ 0 ] ) . has . to . be . equal ( "Hello World" ) ;
28
28
} ) ;
0 commit comments