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', ->
before ->
angular.module('h', [])
require('../../../h/static/scripts/account/account-controller')
require('../account-controller')
beforeEach module('h')
......
......@@ -29,7 +29,7 @@ describe 'h:AuthController', ->
before ->
angular.module('h', [])
require('../../../h/static/scripts/account/auth-controller')
require('../auth-controller')
beforeEach module('h')
beforeEach module('h.templates')
......
bb = require('../../../../h/static/scripts/annotator/plugin/bucket-bar')
bb = require('../bucket-bar')
assert = chai.assert
sinon.assert.expose(assert, prefix: '')
......
cf = require('../../../../h/static/scripts/annotator/plugin/cross-frame')
cf = require('../cross-frame')
assert = chai.assert
sinon.assert.expose(assert, prefix: '')
......
Annotator = require('annotator')
ea = require('../../../h/static/scripts/annotator/plugin/enhancedanchoring')
ea = require('../enhancedanchoring')
assert = chai.assert
sinon.assert.expose(assert, prefix: '')
......
Annotator = require('annotator')
th = require('../../../h/static/scripts/annotator/plugin/texthighlights')
th = require('../texthighlights')
assert = chai.assert
sinon.assert.expose(assert, prefix: '')
......
......@@ -25,7 +25,7 @@ describe 'h.directives.annotation', ->
before ->
angular.module('h', [])
require('../../../h/static/scripts/directives/annotation')
require('../annotation')
beforeEach module('h')
beforeEach module('h.templates')
......
......@@ -16,7 +16,7 @@ describe 'h.directives.privacy', ->
before ->
angular.module('h', [])
require('../../../h/static/scripts/directives/privacy')
require('../privacy')
beforeEach module('h')
beforeEach module('h.templates')
......
......@@ -12,7 +12,7 @@ describe 'h:directives.simple-search', ->
before ->
angular.module('h', [])
require('../../../h/static/scripts/directives/simple-search')
require('../simple-search')
beforeEach module('h')
......
......@@ -10,7 +10,7 @@ describe 'h:directives.status-button', ->
before ->
angular.module('h', [])
require('../../../h/static/scripts/directives/status-button')
require('../status-button')
beforeEach module('h')
......
......@@ -10,7 +10,7 @@ describe 'h:directives.thread', ->
before ->
angular.module('h', [])
require('../../../h/static/scripts/directives/thread')
require('../thread')
beforeEach module('h')
......
......@@ -12,7 +12,7 @@ describe 'h.helpers:form-helpers', ->
before ->
angular.module('h.helpers', [])
require('../../../h/static/scripts/helpers/form-helpers')
require('../form-helpers')
beforeEach module('h.helpers')
......
......@@ -9,7 +9,7 @@ describe 'h.helpers:string-helpers', ->
before ->
angular.module('h.helpers', [])
require('../../../h/static/scripts/helpers/string-helpers')
require('../string-helpers')
beforeEach module('h.helpers')
......
......@@ -44,7 +44,7 @@ describe 'h.helpers:time-helpers', ->
before ->
angular.module('h.helpers', [])
require('../../../h/static/scripts/helpers/time-helpers')
require('../time-helpers')
beforeEach module('h.helpers')
......
......@@ -12,7 +12,7 @@ describe 'h.session', ->
before ->
angular.module('h.session', ['ngResource'])
require('../../h/static/scripts/session/session-service')
require('../session-service')
beforeEach module('h.session')
......
......@@ -14,7 +14,7 @@ describe 'AnnotationMapperService', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/annotation-mapper-service')
require('../annotation-mapper-service')
beforeEach module('h')
beforeEach module ($provide) ->
......
......@@ -15,7 +15,7 @@ describe 'AnnotationSync', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/annotation-sync')
require('../annotation-sync')
beforeEach module('h')
beforeEach inject (AnnotationSync, $rootScope) ->
......
......@@ -9,7 +9,7 @@ describe 'AnnotationUI', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/annotation-ui-service')
require('../annotation-ui-service')
beforeEach module('h')
beforeEach inject (_annotationUI_) ->
......
......@@ -18,7 +18,7 @@ describe 'AnnotationUISync', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/annotation-ui-sync')
require('../annotation-ui-sync')
beforeEach module('h')
beforeEach inject (AnnotationUISync, $rootScope) ->
......
......@@ -11,7 +11,7 @@ describe 'h', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/auth-service')
require('../auth-service')
beforeEach module('h')
......
{module, inject} = require('angular-mock')
Channel = require('../../h/static/scripts/vendor/jschannel.js')
Channel = require('../vendor/jschannel.js')
assert = chai.assert
sinon.assert.expose assert, prefix: null
......@@ -12,7 +12,7 @@ describe 'Bridge', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/bridge')
require('../bridge')
beforeEach module('h')
beforeEach inject (Bridge) ->
......
......@@ -7,7 +7,7 @@ sinon.assert.expose assert, prefix: null
describe 'h:controllers', ->
before ->
angular.module('h', ['ngRoute'])
require('../../h/static/scripts/controllers')
require('../controllers')
describe 'AppController', ->
$scope = null
......
......@@ -19,7 +19,7 @@ describe 'CrossFrameService', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/cross-frame-service')
require('../cross-frame-service')
beforeEach module('h')
beforeEach module ($provide) ->
......
......@@ -6,7 +6,7 @@ assert = chai.assert
describe 'h:directives', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/directives')
require('../directives')
beforeEach module('h')
......
......@@ -12,7 +12,7 @@ describe 'Discovery', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/discovery')
require('../discovery')
beforeEach module('h')
beforeEach inject (Discovery) ->
......
......@@ -7,7 +7,7 @@ describe 'h:filters', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/filters')
require('../filters')
describe 'persona', ->
filter = null
......
Annotator = require('annotator')
Guest = require('../../h/static/scripts/guest')
Guest = require('../guest')
assert = chai.assert
sinon.assert.expose(assert, prefix: '')
......
Annotator = require('annotator')
Host = require('../../h/static/scripts/host')
Host = require('../host')
assert = chai.assert
sinon.assert.expose(assert, prefix: '')
......
......@@ -10,7 +10,7 @@ describe 'h.identity', ->
mockInjectable = {}
before ->
require('../../h/static/scripts/identity-service')
require('../identity-service')
beforeEach module('h.identity')
......
......@@ -10,7 +10,7 @@ describe 'h:permissions', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/permissions-service')
require('../permissions-service')
beforeEach module('h')
......
......@@ -22,7 +22,7 @@ describe 'h:services', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/services')
require('../services')
beforeEach module('h')
......
......@@ -12,7 +12,7 @@ describe 'store', ->
before ->
angular.module('h', ['ngResource'])
require('../../h/static/scripts/store-service')
require('../store-service')
beforeEach module('h')
......
......@@ -12,7 +12,7 @@ describe 'streamer', ->
sandbox = null
before ->
require('../../h/static/scripts/streamer-service')
require('../streamer-service')
beforeEach module('h.streamer')
......
......@@ -9,7 +9,7 @@ describe 'Threading', ->
before ->
angular.module('h', [])
require('../../h/static/scripts/threading-service')
require('../threading-service')
beforeEach module('h')
......
......@@ -43,10 +43,10 @@ module.exports = function(config) {
'h/static/scripts/vendor/sinon.js',
'h/static/scripts/vendor/chai.js',
'h/templates/client/*.html',
'tests/js/bootstrap.coffee',
'h/static/scripts/test/bootstrap.coffee',
// 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