-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
454 additions
and
536 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
## The Test Helper Service | ||
|
||
Opal provides a utility to help you test javascript unit tests. | ||
|
||
To bring it in, import the module and inject the service. | ||
|
||
``` js | ||
|
||
var testHelper; | ||
|
||
beforeEach(function(){ | ||
module('opal.controllers'); | ||
inject(function($injector){ | ||
testHelper = $injector.get('testHelper'); | ||
}); | ||
}); | ||
``` | ||
|
||
The helper has the following functions. | ||
|
||
`newEpisode` provides a new episode. It needs to passed in rootScope as as part | ||
of getting a new episode we update the rootSchema to have the schema | ||
information about subrecords. | ||
|
||
`getEpisodeData` provides the raw data as pull in from the episode api. | ||
|
||
|
||
##### Data Loaders | ||
|
||
`getRecordLoader` provides a mocked up version of the recordloader that | ||
behaves like the normal recordloader. It comes with the `load` function | ||
already spied on. | ||
|
||
`getRecordLoaderData` provides example raw data as pulled from `/api/v0.1/record/` | ||
|
||
|
||
`getMetaDataLoader` provides a mocked up version of the Metadata that | ||
behaves like the normal Metadata. It comes with the `load` function | ||
already spied on. | ||
|
||
`getMetaDataLoader` provides example raw data as pulled from `/api/v0.1/metadata/` | ||
|
||
|
||
`getReferenceDataLoader` provides a mocked up version of the Referencedata that | ||
behaves like the normal Referencedata. It comes with the `load` function | ||
already spied on. | ||
|
||
`getReferenceData` provides example raw data as pulled from `/api/v0.1/referencedata/` | ||
|
||
`getUserProfileLoader` provides a mocked up version of the UserProfile that | ||
behaves like the normal UserProfile. It comes with the `load` function | ||
already spied on. | ||
|
||
`getUserProfile` provides example raw data as pulled from `/api/v0.1/userprofile/` |
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
Oops, something went wrong.