Commit 11d5266e authored by Nick Stenning's avatar Nick Stenning

Move frontend tests alongside tested modules

This commit moves our frontend unit tests into 'test' folders alongside
the modules they are intended to test.

Makes frontend tests consistent with Python tests as of 161baf9.
parent ac89fb81
...@@ -19,7 +19,7 @@ describe 'h:AccountController', -> ...@@ -19,7 +19,7 @@ describe 'h:AccountController', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../../h/static/scripts/account/account-controller') require('../account-controller')
beforeEach module('h') beforeEach module('h')
......
...@@ -29,7 +29,7 @@ describe 'h:AuthController', -> ...@@ -29,7 +29,7 @@ describe 'h:AuthController', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../../h/static/scripts/account/auth-controller') require('../auth-controller')
beforeEach module('h') beforeEach module('h')
beforeEach module('h.templates') beforeEach module('h.templates')
......
bb = require('../../../../h/static/scripts/annotator/plugin/bucket-bar') bb = require('../bucket-bar')
assert = chai.assert assert = chai.assert
sinon.assert.expose(assert, prefix: '') sinon.assert.expose(assert, prefix: '')
......
cf = require('../../../../h/static/scripts/annotator/plugin/cross-frame') cf = require('../cross-frame')
assert = chai.assert assert = chai.assert
sinon.assert.expose(assert, prefix: '') sinon.assert.expose(assert, prefix: '')
......
Annotator = require('annotator') Annotator = require('annotator')
ea = require('../../../h/static/scripts/annotator/plugin/enhancedanchoring') ea = require('../enhancedanchoring')
assert = chai.assert assert = chai.assert
sinon.assert.expose(assert, prefix: '') sinon.assert.expose(assert, prefix: '')
......
Annotator = require('annotator') Annotator = require('annotator')
th = require('../../../h/static/scripts/annotator/plugin/texthighlights') th = require('../texthighlights')
assert = chai.assert assert = chai.assert
sinon.assert.expose(assert, prefix: '') sinon.assert.expose(assert, prefix: '')
......
...@@ -25,7 +25,7 @@ describe 'h.directives.annotation', -> ...@@ -25,7 +25,7 @@ describe 'h.directives.annotation', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../../h/static/scripts/directives/annotation') require('../annotation')
beforeEach module('h') beforeEach module('h')
beforeEach module('h.templates') beforeEach module('h.templates')
......
...@@ -16,7 +16,7 @@ describe 'h.directives.privacy', -> ...@@ -16,7 +16,7 @@ describe 'h.directives.privacy', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../../h/static/scripts/directives/privacy') require('../privacy')
beforeEach module('h') beforeEach module('h')
beforeEach module('h.templates') beforeEach module('h.templates')
......
...@@ -12,7 +12,7 @@ describe 'h:directives.simple-search', -> ...@@ -12,7 +12,7 @@ describe 'h:directives.simple-search', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../../h/static/scripts/directives/simple-search') require('../simple-search')
beforeEach module('h') beforeEach module('h')
......
...@@ -10,7 +10,7 @@ describe 'h:directives.status-button', -> ...@@ -10,7 +10,7 @@ describe 'h:directives.status-button', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../../h/static/scripts/directives/status-button') require('../status-button')
beforeEach module('h') beforeEach module('h')
......
...@@ -10,7 +10,7 @@ describe 'h:directives.thread', -> ...@@ -10,7 +10,7 @@ describe 'h:directives.thread', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../../h/static/scripts/directives/thread') require('../thread')
beforeEach module('h') beforeEach module('h')
......
...@@ -12,7 +12,7 @@ describe 'h.helpers:form-helpers', -> ...@@ -12,7 +12,7 @@ describe 'h.helpers:form-helpers', ->
before -> before ->
angular.module('h.helpers', []) angular.module('h.helpers', [])
require('../../../h/static/scripts/helpers/form-helpers') require('../form-helpers')
beforeEach module('h.helpers') beforeEach module('h.helpers')
......
...@@ -9,7 +9,7 @@ describe 'h.helpers:string-helpers', -> ...@@ -9,7 +9,7 @@ describe 'h.helpers:string-helpers', ->
before -> before ->
angular.module('h.helpers', []) angular.module('h.helpers', [])
require('../../../h/static/scripts/helpers/string-helpers') require('../string-helpers')
beforeEach module('h.helpers') beforeEach module('h.helpers')
......
...@@ -44,7 +44,7 @@ describe 'h.helpers:time-helpers', -> ...@@ -44,7 +44,7 @@ describe 'h.helpers:time-helpers', ->
before -> before ->
angular.module('h.helpers', []) angular.module('h.helpers', [])
require('../../../h/static/scripts/helpers/time-helpers') require('../time-helpers')
beforeEach module('h.helpers') beforeEach module('h.helpers')
......
...@@ -12,7 +12,7 @@ describe 'h.session', -> ...@@ -12,7 +12,7 @@ describe 'h.session', ->
before -> before ->
angular.module('h.session', ['ngResource']) angular.module('h.session', ['ngResource'])
require('../../h/static/scripts/session/session-service') require('../session-service')
beforeEach module('h.session') beforeEach module('h.session')
......
...@@ -14,7 +14,7 @@ describe 'AnnotationMapperService', -> ...@@ -14,7 +14,7 @@ describe 'AnnotationMapperService', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../h/static/scripts/annotation-mapper-service') require('../annotation-mapper-service')
beforeEach module('h') beforeEach module('h')
beforeEach module ($provide) -> beforeEach module ($provide) ->
......
...@@ -15,7 +15,7 @@ describe 'AnnotationSync', -> ...@@ -15,7 +15,7 @@ describe 'AnnotationSync', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../h/static/scripts/annotation-sync') require('../annotation-sync')
beforeEach module('h') beforeEach module('h')
beforeEach inject (AnnotationSync, $rootScope) -> beforeEach inject (AnnotationSync, $rootScope) ->
......
...@@ -9,7 +9,7 @@ describe 'AnnotationUI', -> ...@@ -9,7 +9,7 @@ describe 'AnnotationUI', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../h/static/scripts/annotation-ui-service') require('../annotation-ui-service')
beforeEach module('h') beforeEach module('h')
beforeEach inject (_annotationUI_) -> beforeEach inject (_annotationUI_) ->
......
...@@ -18,7 +18,7 @@ describe 'AnnotationUISync', -> ...@@ -18,7 +18,7 @@ describe 'AnnotationUISync', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../h/static/scripts/annotation-ui-sync') require('../annotation-ui-sync')
beforeEach module('h') beforeEach module('h')
beforeEach inject (AnnotationUISync, $rootScope) -> beforeEach inject (AnnotationUISync, $rootScope) ->
......
...@@ -11,7 +11,7 @@ describe 'h', -> ...@@ -11,7 +11,7 @@ describe 'h', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../h/static/scripts/auth-service') require('../auth-service')
beforeEach module('h') beforeEach module('h')
......
{module, inject} = require('angular-mock') {module, inject} = require('angular-mock')
Channel = require('../../h/static/scripts/vendor/jschannel.js') Channel = require('../vendor/jschannel.js')
assert = chai.assert assert = chai.assert
sinon.assert.expose assert, prefix: null sinon.assert.expose assert, prefix: null
...@@ -12,7 +12,7 @@ describe 'Bridge', -> ...@@ -12,7 +12,7 @@ describe 'Bridge', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../h/static/scripts/bridge') require('../bridge')
beforeEach module('h') beforeEach module('h')
beforeEach inject (Bridge) -> beforeEach inject (Bridge) ->
......
...@@ -7,7 +7,7 @@ sinon.assert.expose assert, prefix: null ...@@ -7,7 +7,7 @@ sinon.assert.expose assert, prefix: null
describe 'h:controllers', -> describe 'h:controllers', ->
before -> before ->
angular.module('h', ['ngRoute']) angular.module('h', ['ngRoute'])
require('../../h/static/scripts/controllers') require('../controllers')
describe 'AppController', -> describe 'AppController', ->
$scope = null $scope = null
......
...@@ -19,7 +19,7 @@ describe 'CrossFrameService', -> ...@@ -19,7 +19,7 @@ describe 'CrossFrameService', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../h/static/scripts/cross-frame-service') require('../cross-frame-service')
beforeEach module('h') beforeEach module('h')
beforeEach module ($provide) -> beforeEach module ($provide) ->
......
...@@ -6,7 +6,7 @@ assert = chai.assert ...@@ -6,7 +6,7 @@ assert = chai.assert
describe 'h:directives', -> describe 'h:directives', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../h/static/scripts/directives') require('../directives')
beforeEach module('h') beforeEach module('h')
......
...@@ -12,7 +12,7 @@ describe 'Discovery', -> ...@@ -12,7 +12,7 @@ describe 'Discovery', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../h/static/scripts/discovery') require('../discovery')
beforeEach module('h') beforeEach module('h')
beforeEach inject (Discovery) -> beforeEach inject (Discovery) ->
......
...@@ -7,7 +7,7 @@ describe 'h:filters', -> ...@@ -7,7 +7,7 @@ describe 'h:filters', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../h/static/scripts/filters') require('../filters')
describe 'persona', -> describe 'persona', ->
filter = null filter = null
......
Annotator = require('annotator') Annotator = require('annotator')
Guest = require('../../h/static/scripts/guest') Guest = require('../guest')
assert = chai.assert assert = chai.assert
sinon.assert.expose(assert, prefix: '') sinon.assert.expose(assert, prefix: '')
......
Annotator = require('annotator') Annotator = require('annotator')
Host = require('../../h/static/scripts/host') Host = require('../host')
assert = chai.assert assert = chai.assert
sinon.assert.expose(assert, prefix: '') sinon.assert.expose(assert, prefix: '')
......
...@@ -10,7 +10,7 @@ describe 'h.identity', -> ...@@ -10,7 +10,7 @@ describe 'h.identity', ->
mockInjectable = {} mockInjectable = {}
before -> before ->
require('../../h/static/scripts/identity-service') require('../identity-service')
beforeEach module('h.identity') beforeEach module('h.identity')
......
...@@ -10,7 +10,7 @@ describe 'h:permissions', -> ...@@ -10,7 +10,7 @@ describe 'h:permissions', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../h/static/scripts/permissions-service') require('../permissions-service')
beforeEach module('h') beforeEach module('h')
......
...@@ -22,7 +22,7 @@ describe 'h:services', -> ...@@ -22,7 +22,7 @@ describe 'h:services', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../h/static/scripts/services') require('../services')
beforeEach module('h') beforeEach module('h')
......
...@@ -12,7 +12,7 @@ describe 'store', -> ...@@ -12,7 +12,7 @@ describe 'store', ->
before -> before ->
angular.module('h', ['ngResource']) angular.module('h', ['ngResource'])
require('../../h/static/scripts/store-service') require('../store-service')
beforeEach module('h') beforeEach module('h')
......
...@@ -12,7 +12,7 @@ describe 'streamer', -> ...@@ -12,7 +12,7 @@ describe 'streamer', ->
sandbox = null sandbox = null
before -> before ->
require('../../h/static/scripts/streamer-service') require('../streamer-service')
beforeEach module('h.streamer') beforeEach module('h.streamer')
......
...@@ -9,7 +9,7 @@ describe 'Threading', -> ...@@ -9,7 +9,7 @@ describe 'Threading', ->
before -> before ->
angular.module('h', []) angular.module('h', [])
require('../../h/static/scripts/threading-service') require('../threading-service')
beforeEach module('h') beforeEach module('h')
......
...@@ -43,10 +43,10 @@ module.exports = function(config) { ...@@ -43,10 +43,10 @@ module.exports = function(config) {
'h/static/scripts/vendor/sinon.js', 'h/static/scripts/vendor/sinon.js',
'h/static/scripts/vendor/chai.js', 'h/static/scripts/vendor/chai.js',
'h/templates/client/*.html', 'h/templates/client/*.html',
'tests/js/bootstrap.coffee', 'h/static/scripts/test/bootstrap.coffee',
// Tests // Tests
'tests/js/**/*-test.coffee', 'h/static/scripts/**/*-test.coffee'
], ],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment