Angular mocks for Horizon rest API and window
Create shared client-side mock objects in angular to ensure high quality client-side tests.
Blueprint information
- Status:
- Complete
- Approver:
- David Lyle
- Priority:
- Undefined
- Drafter:
- Shaoquan Chen
- Direction:
- Needs approval
- Assignee:
- Shaoquan Chen
- Definition:
- Obsolete
- Series goal:
- Proposed for liberty
- Implementation:
- Started
- Milestone target:
- None
- Started by
- Shaoquan Chen
- Completed by
- David Lyle
Related branches
Related bugs
Sprints
Whiteboard
Summary:
Create shared client-side mock objects in angular to ensure high quality client-side tests.
Motivation:
Currently random mock objects are created inside of spec files to make writing unit tests easier. This approach has some drawback though:
* mocks are not sharable between specs.
* mocks are usually too simple.
* mocks may not be consistent between spec files.
* mocks are not tested theme self.
* hard to maintain and manage.
Description:
* mocks should reside in ``.mock.js`` files and be loaded only in test runner page
* mocks should be loaded after production code files, before spec code files.
* mocks should be sharable between specs.
* mocks are not belong to specs, they should have a 1:1 relationship with the object it try to mock.
* mocks should be at a level as low as possible, maybe where JavaScript cannot reach directly.
* mocks must be tested theme self.
* mocks should be easy to find, use and manage.
Scope:
This BP will provides these mocks:
* mockWindow
* mockOpenStackHt
UX:
N/A
Outside Dependencies:
N/A
Doc Impact:
May need to update the Angular part.
Gerrit topic: https:/
Addressed by: https:/
Mock API - Basic mock API server constructor
Addressed by: https:/
Mock API - mock 404 error
Addressed by: https:/
Mock API - mock 401 error
[david-lyle | 2016-06-15] This blueprint never really caught interest and is without an active owner. I'm marking obsolete. If someone is interested in this idea, propose it again.