This repository has been archived by the owner on Apr 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Global nav role switcher hooked up (#45)
Addresses story #2 and task #5 The dashboard page currently doesn't call the getAdminData. I'll hook that up next to a real lifecycle or action. Here is what everything looks like: ![screen recording 2016-09-08 at 04 48 pm](https://cloud.githubusercontent.com/assets/8884298/18371523/8d6ef1f0-75fa-11e6-812d-cfc0ad53b272.gif) ## Other changes in this PR - Tests now inject the tap event plugin, so that MUI components dont spit out errors - Test config removes extra quotes from stringified json strings. ### Demo Data Flow - demo module now handles fetching data associated with a demo session and logs in to the supplychainmanager automatically - Dashboard component no longer manages data fetching on route loading, instead it is handled properly within the route itself. - CreateDemo saga now simply creates a demo and changes the route (In a future task, I want to have it manage adding one retail manager automatically so that demos always begin with that role as a default) ### Mock API / stronger saga tests - Sagas tests now make use of state changes from actually calling the reducer, which requires proper data passed in....meaning I needed a way to mock the API calls. I made a mock file that gives back faker data in the shape we currently expect from the API. What this allows, is for saga tests to properly fail if things change in the way data is passed around and modified (whereas before, we just generated made up objects and so it worked in test, but not in the running app) The Saga tests look a bit more confusing, but are WAY more solid now. Writing and testing complex async actions has never been fun, but this makes them accurate and stable, which is the real win.
- Loading branch information
1 parent
44591c4
commit 9628d07
Showing
37 changed files
with
801 additions
and
541 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,15 @@ | ||
/* GlobalNav Styles */ | ||
.globalNav { | ||
p { | ||
color: rgb(255, 255, 255); | ||
} | ||
} | ||
@import '~styles/base/colors'; | ||
|
||
.title { | ||
padding-left: 2rem; | ||
} | ||
|
||
.separator { | ||
background-color: rgb(184, 222, 228); | ||
color: $alternateTextColor; | ||
} | ||
|
||
.github { | ||
font-size: 1.9rem; | ||
color: rgb(184, 222, 228); | ||
color: $primary3Color; | ||
|
||
&:hover { | ||
color: rgb(255, 255, 255); | ||
} | ||
} | ||
|
||
/* RoleSwitcher Styles */ | ||
.stack { | ||
position: relative; | ||
cursor: pointer; | ||
margin-right: 30px; | ||
|
||
.user { | ||
font-size: 1.2rem; | ||
color: rgb(15, 147, 166); | ||
line-height: 3.3rem; | ||
margin-left: .3rem; | ||
} | ||
|
||
&:hover { | ||
.circle { | ||
color: rgb(255, 255, 255); | ||
} | ||
} | ||
|
||
.circle { | ||
font-size: 1.9rem; | ||
color: rgb(184, 222, 228); | ||
line-height: 3.3rem; | ||
color: $alternateTextColor; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,22 @@ | ||
import test from 'ava'; | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
// import { Icon } from 'react-fa'; | ||
import GlobalNav from './GlobalNav'; | ||
|
||
|
||
const setup = () => { | ||
// const spies = { | ||
// clicky: sinon.spy(), | ||
// }; | ||
// const props = { | ||
// customProp: 'Test', | ||
// clicky: spies.clicky, | ||
// }; | ||
const spies = { | ||
}; | ||
const props = { | ||
}; | ||
const component = shallow(<GlobalNav />); | ||
|
||
return { component }; | ||
return { component, props, spies }; | ||
}; | ||
|
||
test('(Component) Has expected elements.', t => { | ||
const { component } = setup(); | ||
|
||
// t.is(component.find('Icon'), 1, | ||
// 'contains React-FA Github Icons.'); | ||
// t.true(component.contains('<RoleSwitcher />'), | ||
// 'contains RoleSwitcher component.'); | ||
// t.true(component.contains('<Toolbar />'), | ||
// 'contains Toolbar component.'); | ||
|
||
t.is(component.find('Icon').length, 1); | ||
t.is(component.find('RoleSwitcher').length, 1); | ||
t.is(component.find('Toolbar').length, 1); | ||
t.is(component.find('Connect(RoleSwitcher)').length, 1); | ||
t.is(component.find('Link').length, 1); | ||
t.is(component.find('Link').first().props().to, '/'); | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.