George Vrancianu 8 лет назад
Родитель
Сommit
e502fc8737

+ 23 - 0
src/__tests__/LoginPage.test.js

@@ -0,0 +1,23 @@
+import React from 'react';
+import { shallow } from 'enzyme';
+import App from '../components/App'
+import { LoginPage } from '../components/LoginPage';
+import renderer from 'react-test-renderer';
+
+describe('Login Page', () => {
+  it('renders correctly', () => {
+    const tree = renderer.create(
+      <App context={{ insertCss: () => {} }}>
+        <LoginPage />
+      </App>
+    ).toJSON();
+    expect(tree).toMatchSnapshot();
+  });
+
+  it('changes user name', () => {
+    const LoginPage = shallow(
+      <LoginPage />
+    )
+    expect()
+  })
+})

Разница между файлами не показана из-за своего большого размера
+ 77 - 0
src/__tests__/__snapshots__/LoginPage.test.js.snap


+ 1 - 1
src/components/LoginPage/LoginPage.js

@@ -82,7 +82,7 @@ const loginButtons = [
   }
 ]
 
-class LoginPage extends Reflux.Component {
+export class LoginPage extends Reflux.Component {
 
   static contextTypes = {
     onSetTitle: PropTypes.func.isRequired

Некоторые файлы не были показаны из-за большого количества измененных файлов