jest.dontMock('../Header.jsx'); describe('Header', function() { it('changes location to projectList: my when clicking on the brand', function() { var React = require('react/addons'); var TestUtils = React.addons.TestUtils; var Header = require('../Header.jsx'); var AppActions = require('../../actions/AppActions'); var Location = require('../../stores/Location.js'); Location.getLocation.mockReturnValueOnce({ projectList: 'my' }); var ui = TestUtils.renderIntoDocument(<Header />); TestUtils.Simulate.click(React.findDOMNode(ui.refs.brand)); expect(AppActions.changeLocation).toBeCalledWith({ projectList: 'my' }); expect(ui.refs.createProject).toBeUndefined(); }); it('shows the create project item if location is createProject: true', function() { var React = require('react/addons'); var TestUtils = React.addons.TestUtils; var Header = require('../Header.jsx'); var AppActions = require('../../actions/AppActions'); var Location = require('../../stores/Location.js'); Location.getLocation.mockReturnValueOnce({ createProject: true }); var ui = TestUtils.renderIntoDocument(<Header />); expect(ui.refs.createProject).toBeDefined(); }); it('shows the project details item if location is project: "example"', function() { var React = require('react/addons'); var TestUtils = React.addons.TestUtils; var Header = require('../Header.jsx'); var AppActions = require('../../actions/AppActions'); var Location = require('../../stores/Location.js'); Location.getLocation.mockReturnValueOnce({ project: "example" }); var ui = TestUtils.renderIntoDocument(<Header />); expect(ui.refs.createProject).toBeUndefined(); expect(ui.refs.project).toBeDefined(); }); });
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15688 | Doug Scheirer |
Populate -o //guest/perforce_software/helix-web-services/... //guest/doug_scheirer/helix-web-services/.... |
||
//guest/perforce_software/helix-web-services/main/source/helix_web_components/project_management/components/__tests__/Header-test.js | |||||
#1 | 15622 | tjuricek |
Move source code to 'source/' subdirectory of branch. build/ will remain where it is. |
||
//guest/perforce_software/helix-web-services/main/helix_web_components/project_management/components/__tests__/Header-test.js | |||||
#1 | 13974 | tjuricek |
Moving 'ui/static' to 'helix_web_components' project, and altering some notes. Also, removed obsolete top-level Rake tasks. The "Helix Web Components" project will likely get moved elsewhere in the future. |
||
//guest/perforce_software/helix-web-services/main/ui/static/project_management/components/__tests__/Header-test.js | |||||
#1 | 13971 | tjuricek |
Add the ability for the header to display a "subnav" element. This is likely not our final UI, we may need to customize an individual nav-item to function like a breadcrumb. But functionally, it's working, the behavior should be the same. |