Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Fix tsx Integration Tests #678

Merged
merged 2 commits into from
Sep 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/unit/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ import './diff';
import './RegistryHandler';
import './Injector';
import './tsx';
import './tsxIntegration';
import './NodeHandler';
import './meta/all';
10 changes: 8 additions & 2 deletions tests/unit/testIntegration.tsx → tests/unit/tsxIntegration.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import * as registerSuite from 'intern!object';
import * as assert from 'intern/chai!assert';
import { WidgetBase } from '../../src/WidgetBase';
import { registry } from '../../src/d';
import { Registry } from '../../src/Registry';
import { WidgetProperties } from '../../src/interfaces';
import { VNode } from '@dojo/interfaces/vdom';
import { fromRegistry } from './../../src/tsx';
import { tsx, fromRegistry } from './../../src/tsx';

const registry = new Registry();

registerSuite({
name: 'tsx',
Expand Down Expand Up @@ -36,12 +38,16 @@ registerSuite({
}

const bar = new Bar();
bar.__setCoreProperties__({ registry });
bar.__setProperties__({ registry });
const barRender = bar.__render__() as VNode;
const barChild = barRender.children![0];
assert.equal(barRender.vnodeSelector, 'header');
assert.equal(barChild.text, 'world');

const qux = new Qux();
qux.__setCoreProperties__({ registry });
qux.__setProperties__({ registry });
const firstQuxRender = qux.__render__();
assert.equal(firstQuxRender, null);

Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"./src/**/*.ts",
"./src/**/*.tsx",
"./tests/**/*.ts",
"./tests/**/*.tsx",
"./typings/index.d.ts"
]
}