Horizon angular mocks
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 themselves.
* 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.
Blueprint information
- Status:
- Complete
- Approver:
- David Lyle
- Priority:
- Undefined
- Drafter:
- Shaoquan Chen
- Direction:
- Needs approval
- Assignee:
- Shaoquan Chen
- Definition:
- Obsolete
- Series goal:
- None
- Implementation:
- Started
- Milestone target:
- None
- Started by
- Shaoquan Chen
- Completed by
- David Lyle
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
Angular-mock: using mock $window object
Addressed by: https:/
Angular-mock: mock $window object
[david-lyle | 2016-06-15] This never really gained traction and lost its proponent, marking obsolete.