aboutsummaryrefslogtreecommitdiff
path: root/node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-05-24 15:10:37 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-05-24 15:11:17 +0200
commit7a3df06eb573d36142bd1a8e03c5ce8752d300b3 (patch)
tree70bfaea8884c374876f607774850a3a51c0cb381 /node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test
parentaca1143cb9eed16cf37f04e475e4257418dd18ac (diff)
fix build issues and add typedoc
Diffstat (limited to 'node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test')
-rw-r--r--node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test/components/App.tests.tsx32
-rw-r--r--node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test/components/Greeting.tests.tsx45
-rw-r--r--node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test/components/WhoToGreet.tests.tsx68
-rw-r--r--node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test/main.js5
4 files changed, 0 insertions, 150 deletions
diff --git a/node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test/components/App.tests.tsx b/node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test/components/App.tests.tsx
deleted file mode 100644
index aa9612416..000000000
--- a/node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test/components/App.tests.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import React from 'react';
-import TestUtils from 'react-addons-test-utils';
-
-import App from '../../src/components/App';
-import WhoToGreet from '../../src/components/WhoToGreet';
-import Greeting from '../../src/components/Greeting';
-import GreetingStore from '../../src/stores/GreetingStore';
-
-describe('App', () => {
- it('renders expected HTML', () => {
- const app = render({ greetings: ['James'], newGreeting: 'Benjamin' });
- expect(app).toEqual(
- <div className="container-fluid">
- <h1>Hello People!</h1>
-
- <WhoToGreet newGreeting={ 'Benjamin' } />
-
- { [
- <Greeting key={ 0 } targetOfGreeting="James" />
- ] }
- </div>
- );
- });
-
- function render(state: any) {
- const shallowRenderer = TestUtils.createRenderer();
- spyOn(GreetingStore, 'getState').and.returnValue(state);
-
- shallowRenderer.render(<App />);
- return shallowRenderer.getRenderOutput();
- }
-});
diff --git a/node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test/components/Greeting.tests.tsx b/node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test/components/Greeting.tests.tsx
deleted file mode 100644
index 911a6cba2..000000000
--- a/node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test/components/Greeting.tests.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import React from 'react';
-import TestUtils from 'react-addons-test-utils';
-
-import Greeting from '../../src/components/Greeting';
-import * as GreetingActions from '../../src/actions/GreetingActions';
-
-describe('Greeting', () => {
- let handleSelectionChangeSpy: jasmine.Spy;
- beforeEach(() => {
- handleSelectionChangeSpy = jasmine.createSpy('handleSelectionChange');
- });
-
- it('given a targetOfGreeting of \'James\' it renders a p containing a greeting and a remove button', () => {
- const targetOfGreeting = 'James';
-
- const p = render({ targetOfGreeting });
- expect(p.type).toBe('p');
- expect(p.props.children[0]).toBe('Hello ');
- expect(p.props.children[1]).toBe('James');
- expect(p.props.children[2]).toBe('!');
-
- const [ , , , button ] = p.props.children;
-
- expect(button.type).toBe('button');
- expect(button.props.className).toBe('btn btn-default btn-danger');
- expect(button.props.children).toBe('Remove');
- });
-
- it('button onClick triggers an removeGreeting action', () => {
- const targetOfGreeting = 'Benjamin';
- const p = render({ targetOfGreeting });
- const [ , , , button ] = p.props.children;
- spyOn(GreetingActions, 'removeGreeting');
-
- button.props.onClick();
-
- expect(GreetingActions.removeGreeting).toHaveBeenCalledWith(targetOfGreeting);
- });
-
- function render({ targetOfGreeting }: { targetOfGreeting: string; }) {
- const shallowRenderer = TestUtils.createRenderer();
- shallowRenderer.render(<Greeting key={ 0 } targetOfGreeting={ targetOfGreeting } />);
- return shallowRenderer.getRenderOutput();
- }
-});
diff --git a/node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test/components/WhoToGreet.tests.tsx b/node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test/components/WhoToGreet.tests.tsx
deleted file mode 100644
index 01398952e..000000000
--- a/node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test/components/WhoToGreet.tests.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import React from 'react';
-import TestUtils from 'react-addons-test-utils';
-
-import WhoToGreet from '../../src/components/WhoToGreet';
-import * as GreetingActions from '../../src/actions/GreetingActions';
-
-describe('WhoToGreet', () => {
- let handleSelectionChangeSpy: jasmine.Spy;
- beforeEach(() => {
- handleSelectionChangeSpy = jasmine.createSpy('handleSelectionChange');
- });
-
- it('given a newGreeting then it renders a form containing an input containing that text and an add button', () => {
- const newGreeting = 'James';
-
- const form = render({ newGreeting });
- expect(form.type).toBe('form');
- expect(form.props.role).toBe('form');
-
- const formGroup = form.props.children;
- expect(formGroup.type).toBe('div');
- expect(formGroup.props.className).toBe('form-group');
-
- const [ input, button ] = formGroup.props.children;
-
- expect(input.type).toBe('input');
- expect(input.props.type).toBe('text');
- expect(input.props.className).toBe('form-control');
- expect(input.props.placeholder).toBe('Who would you like to greet?');
- expect(input.props.value).toBe(newGreeting);
-
- expect(button.type).toBe('button');
- expect(button.props.type).toBe('submit');
- expect(button.props.className).toBe('btn btn-default btn-primary');
- expect(button.props.disabled).toBe(false);
- expect(button.props.children).toBe('Add greeting');
- });
-
- it('input onChange triggers a newGreetingChanged action', () => {
- const newGreeting = 'Benjamin';
- const form = render({ newGreeting });
- const formGroup = form.props.children;
- const [ input ] = formGroup.props.children;
- spyOn(GreetingActions, 'newGreetingChanged');
-
- input.props.onChange({ target: { value: newGreeting }});
-
- expect(GreetingActions.newGreetingChanged).toHaveBeenCalledWith(newGreeting);
- });
-
- it('button onClick triggers an addGreeting action', () => {
- const newGreeting = 'Benjamin';
- const form = render({ newGreeting });
- const formGroup = form.props.children;
- const [ , button ] = formGroup.props.children;
- spyOn(GreetingActions, 'addGreeting');
-
- button.props.onClick({ preventDefault: () => {} });
-
- expect(GreetingActions.addGreeting).toHaveBeenCalledWith(newGreeting);
- });
-
- function render({ newGreeting }: { newGreeting: string }) {
- const shallowRenderer = TestUtils.createRenderer();
- shallowRenderer.render(<WhoToGreet newGreeting={ newGreeting } />);
- return shallowRenderer.getRenderOutput();
- }
-});
diff --git a/node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test/main.js b/node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test/main.js
deleted file mode 100644
index 1b332a7c0..000000000
--- a/node_modules/ts-loader/examples/webpack2-gulp-react-flux-babel-karma/test/main.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/* eslint-disable */
-import 'babel-polyfill';
-
-const testsContext = require.context('./', true, /\.tests\.ts(x?)$/);
-testsContext.keys().forEach(testsContext); \ No newline at end of file