diff --git a/.meteor/packages b/.meteor/packages
index cc1385b..cdf2bef 100644
--- a/.meteor/packages
+++ b/.meteor/packages
@@ -30,3 +30,7 @@ alanning:roles
react-meteor-data
themeteorchef:jquery-validation
themeteorchef:bert
+static-html
+xolvio:cleaner
+practicalmeteor:mocha
+xolvio:backdoor
diff --git a/.meteor/versions b/.meteor/versions
index 4fd1c29..c3295e7 100644
--- a/.meteor/versions
+++ b/.meteor/versions
@@ -24,6 +24,7 @@ caching-compiler@1.0.2
caching-html-compiler@1.0.4
callback-hook@1.0.6
check@1.1.2
+coffeescript@1.0.15
ddp@1.2.3
ddp-client@1.2.3
ddp-common@1.2.3
@@ -66,6 +67,11 @@ npm-bcrypt@0.7.8_2
npm-mongo@1.4.41
observe-sequence@1.0.9
ordered-dict@1.0.5
+practicalmeteor:chai@2.1.0_1
+practicalmeteor:loglevel@1.2.0_2
+practicalmeteor:mocha@2.1.0_8
+practicalmeteor:mocha-core@0.1.4
+practicalmeteor:sinon@1.14.1_2
promise@0.6.5
raix:eventemitter@0.1.3
random@1.0.7
@@ -84,14 +90,18 @@ spacebars-compiler@1.0.9
srp@1.0.6
standard-minifier-css@1.0.4
standard-minifier-js@1.0.4
+static-html@1.0.5
templating@1.1.7
templating-tools@1.0.2
themeteorchef:bert@2.1.0
themeteorchef:jquery-validation@1.14.0
tmeasday:check-npm-versions@0.2.0
+tmeasday:test-reporter-helpers@0.2.1
tracker@1.0.11
ui@1.0.9
underscore@1.0.6
url@1.0.7
webapp@1.2.6
webapp-hashing@1.0.7
+xolvio:backdoor@0.1.2
+xolvio:cleaner@0.2.0
diff --git a/client/main.html b/client/main.html
new file mode 100644
index 0000000..714e77f
--- /dev/null
+++ b/client/main.html
@@ -0,0 +1,12 @@
+
+
+ Application Name
+
+
+
+
+
+
+
+
+
diff --git a/client/stylesheets/application.scss b/client/stylesheets/application.scss
index 33332f0..a89b7d4 100644
--- a/client/stylesheets/application.scss
+++ b/client/stylesheets/application.scss
@@ -6,3 +6,5 @@
@import "module/loading";
@import "module/login";
@import "module/signup";
+
+@import "state/navbar";
diff --git a/client/stylesheets/state/_navbar.scss b/client/stylesheets/state/_navbar.scss
new file mode 100644
index 0000000..6445062
--- /dev/null
+++ b/client/stylesheets/state/_navbar.scss
@@ -0,0 +1,6 @@
+.navbar-default .navbar-nav > li > a.active,
+.navbar-default .navbar-nav > li > a.active:focus,
+.navbar-default .navbar-nav > li > a.active:hover {
+ color: #555;
+ background-color: #e7e7e7;
+}
diff --git a/imports/startup/client/routes.jsx b/imports/startup/client/routes.jsx
index ef89203..b173ed3 100644
--- a/imports/startup/client/routes.jsx
+++ b/imports/startup/client/routes.jsx
@@ -19,15 +19,7 @@ const requireAuth = ( nextState, replace ) => {
}
};
-const renderReactRoot = () => {
- let container = document.createElement( 'div' );
- container.id = 'react-root';
- document.body.appendChild( container );
-};
-
Meteor.startup( () => {
- renderReactRoot();
-
render(
diff --git a/imports/ui/components/app-navigation.js b/imports/ui/components/app-navigation.js
index 4427de7..701cf6b 100644
--- a/imports/ui/components/app-navigation.js
+++ b/imports/ui/components/app-navigation.js
@@ -1,5 +1,6 @@
import React from 'react';
import { Navbar, Nav, NavItem, NavDropdown, MenuItem } from 'react-bootstrap';
+import { Link } from 'react-router';
import { PublicNavigation } from './public-navigation';
import { AuthenticatedNavigation } from './authenticated-navigation';
@@ -12,10 +13,13 @@ export class AppNavigation extends React.Component {
return
- Application Name
+ Application Name
+
- { this.renderNavigation( this.props.hasUser, this.props.activeRoute ) }
+
+ { this.renderNavigation( this.props.hasUser, this.props.activeRoute ) }
+
;
}
}
diff --git a/imports/ui/components/authenticated-navigation.js b/imports/ui/components/authenticated-navigation.js
index f9ef139..dfa778c 100644
--- a/imports/ui/components/authenticated-navigation.js
+++ b/imports/ui/components/authenticated-navigation.js
@@ -1,7 +1,6 @@
import React from 'react';
-import { browserHistory } from 'react-router';
+import { browserHistory, IndexLink, Link } from 'react-router';
import { Nav, NavItem, NavDropdown, MenuItem } from 'react-bootstrap';
-import { IndexLinkContainer, LinkContainer } from 'react-router-bootstrap';
const handleLogout = () => {
return Meteor.logout( () => browserHistory.push( '/login' ) );
@@ -15,28 +14,16 @@ const userName = () => {
}
};
-export const AuthenticatedNavigation = React.createClass({
- isActive( route, indexOnly ) {
- return this.props.activeRoute( route, indexOnly );
- },
- handleRouteChange() {
- this.forceUpdate();
- },
- render() {
- return
-
-
-
;
- }
-});
+export const AuthenticatedNavigation = () => (
+
+
+
+
+)
diff --git a/imports/ui/components/public-navigation.js b/imports/ui/components/public-navigation.js
index f97999f..0304c69 100644
--- a/imports/ui/components/public-navigation.js
+++ b/imports/ui/components/public-navigation.js
@@ -2,21 +2,9 @@ import React from 'react';
import { Link } from 'react-router';
import { Nav, NavItem } from 'react-bootstrap';
-export const PublicNavigation = React.createClass({
- isActive( route, indexOnly ) {
- return this.props.activeRoute( route, indexOnly ) ? 'active' : '';
- },
- handleRouteChange() {
- this.forceUpdate();
- },
- render() {
- return ;
- }
-});
+export const PublicNavigation = () => (
+
+)
diff --git a/package.json b/package.json
index d0d359f..7b57d18 100644
--- a/package.json
+++ b/package.json
@@ -4,11 +4,14 @@
"description": "Application description.",
"scripts": {
"start": "meteor --settings settings-development.json",
+ "chimp-watch": "chimp --ddp=http://localhost:3000 --watch --mocha --path=tests",
+ "chimp-test": "chimp --ddp=http://localhost:3000 --mocha --path=tests",
"staging": "meteor deploy staging.meteor.com --settings settings-development.json",
"production": "meteor deploy production.meteor.com --settings settings-production.json"
},
"devDependencies": {},
"dependencies": {
+ "chimp": "^0.33.0",
"react": "^0.14.8",
"react-addons-pure-render-mixin": "^0.14.8",
"react-bootstrap": "^0.28.4",
diff --git a/tests/login.js b/tests/login.js
new file mode 100644
index 0000000..dac25a4
--- /dev/null
+++ b/tests/login.js
@@ -0,0 +1,30 @@
+describe( 'Log In', function() {
+ beforeEach( function() {
+ server.execute( function() {
+ var user = Meteor.users.findOne( { 'emails.address': 'carl.winslow@abc.com' } );
+ if ( user ) {
+ Meteor.users.remove( user._id );
+ }
+ });
+ });
+
+ it( 'should allow us to login @watch', function() {
+ server.execute( function() {
+ Accounts.createUser({
+ email: 'carl.winslow@abc.com',
+ password: 'bigguy1989',
+ profile: {
+ name: { first: 'Carl', last: 'Winslow' }
+ }
+ });
+ });
+
+ browser.url( 'http://localhost:3000/login' )
+ .setValue( '[name="emailAddress"]', 'carl.winslow@abc.com' )
+ .setValue( '[name="password"]', 'bigguy1989' )
+ .submitForm( 'form' );
+
+ browser.waitForExist( '.jumbotron' );
+ expect( browser.getUrl() ).to.equal( 'http://localhost:3000/' );
+ });
+});
diff --git a/tests/signup.js b/tests/signup.js
new file mode 100644
index 0000000..8c64042
--- /dev/null
+++ b/tests/signup.js
@@ -0,0 +1,22 @@
+describe( 'Sign Up', function() {
+ beforeEach( function() {
+ server.execute( function() {
+ var user = Meteor.users.findOne( { 'emails.address': 'carl.winslow@abc.com' } );
+ if ( user ) {
+ Meteor.users.remove( user._id );
+ }
+ });
+ });
+
+ it( 'should create a new user and login with redirect to index @watch', function() {
+ browser.url( 'http://localhost:3000/signup' )
+ .setValue( '[name="firstName"]', 'Carl' )
+ .setValue( '[name="lastName"]', 'Winslow' )
+ .setValue( '[name="emailAddress"]', 'carl.winslow@abc.com' )
+ .setValue( '[name="password"]', 'bigguy1989' )
+ .submitForm( 'form' );
+
+ browser.waitForExist( '.jumbotron' );
+ expect( browser.getUrl() ).to.equal( 'http://localhost:3000/' );
+ });
+});