Horizon angular mocks

Registered by Shaoquan Chen

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
* mockOpenStackHttpServer

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

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/horizon-angular-mocks,n,z

Addressed by: https://review.openstack.org/202830
    Angular-mock: using mock $window object

Addressed by: https://review.openstack.org/202817
    Angular-mock: mock $window object

[david-lyle | 2016-06-15] This never really gained traction and lost its proponent, marking obsolete.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.