Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Running "test:server" (test) task
- (node:6413) DeprecationWarning: sys is deprecated. Use util instead.
- Running "env:test" (env) task
- Running "eslint:all" (eslint) task
- Running "jsonlint:all" (jsonlint) task
- >> 62 files lint free.
- Running "mochacli:server" (mochacli) task
- Adding Array.prototype.tap for tests
- Stubbing agenda
- Swagger: skipping unknown type "GeoJSON.Point".
- Swagger: skipping unknown type "GeoJSON.Polygon".
- Stubbing Email
- Agenda ready
- Forms mounted: 0 success, 0 failures
- Boot sequence completed
- agenda
- ✓ should be available via app.get("agendaInstance")
- Account
- API
- POST /Accounts/login
- Thu, 12 Jan 2017 17:17:39 GMT loopback deprecated loopback#context middleware is deprecated. See https://docs.strongloop.com/display/APIC/Using%20current%20context for more details. at node_modules/loopback/server/middleware/rest.js:60:32
- ✓ should login (238ms)
- ✓ should include user and its resource when requested (73ms)
- ✓ should deal with capitalized email (43ms)
- Through geotab auth
- ✓ should include user even if geotab auth is successful (73ms)
- protect higher level accounts
- POST /Accounts
- ✓ As "Admin", create "Supervisor" should work
- ✓ As "contractor", create "Supervisor" should fail
- ✓ As "Project Manager", create "Project Manager" should work
- PUT /Accounts/:id
- 1) As "Admin", update "Supervisor" to "Admin" should work
- 2) As "Supervisor", update "" to "Foreman" should work
- 3) As "Supervisor", update "Foreman" to "Project Manager" should fail
- ✓ As "contractor", update "Supervisor" to "Foreman" should fail
- ✓ As "contractor", update self to "Foreman" should fail
- 4) As "Supervisor", updating a "Foreman" should work
- 5) As "Supervisor", updating a "Project Manager" should fail
- DELETE /Accounts/:id
- 6) As "Admin", delete "Supervisor" should work
- 7) As "Supervisor", delete "Project Manager" should fail
- AerialInspection
- API
- Swagger: skipping unknown type "GeoJSON.Point".
- Swagger: skipping unknown type "GeoJSON.Polygon".
- GET
- A form was submitted without an installation mapped to the user
- Error sending defecting notification TypeError: Cannot read property 'id' of null
- at Role.findOne.then.role (/home/lemb/Projects/wyzeio/common/models/account.js:463:25)
- at /home/lemb/Projects/wyzeio/node_modules/async-listener/glue.js:188:31
- at _combinedTickCallback (internal/process/next_tick.js:67:7)
- at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:122:9)
- From previous event:
- at Function.Account.findAdmins (/home/lemb/Projects/wyzeio/common/models/account.js:468:8)
- at ModelConstructor.findAccountToEmailTo (/home/lemb/Projects/wyzeio/common/forms/aerial-inspection.js:71:10)
- at ModelConstructor.sendDefectEmail (/home/lemb/Projects/wyzeio/common/forms/aerial-inspection.js:58:16)
- at AerialInspection.afterRemote (/home/lemb/Projects/wyzeio/common/forms/aerial-inspection.js:17:14)
- at Function.<anonymous> (/home/lemb/Projects/wyzeio/node_modules/loopback/lib/model.js:216:18)
- at execStack (/home/lemb/Projects/wyzeio/node_modules/strong-remoting/lib/remote-objects.js:485:26)
- at RemoteObjects.execHooks (/home/lemb/Projects/wyzeio/node_modules/strong-remoting/lib/remote-objects.js:497:10)
- at phaseAfterInvoke (/home/lemb/Projects/wyzeio/node_modules/strong-remoting/lib/remote-objects.js:661:10)
- at runHandler (/home/lemb/Projects/wyzeio/node_modules/loopback-phase/lib/phase.js:135:5)
- at iterate (/home/lemb/Projects/wyzeio/node_modules/loopback-phase/node_modules/async/lib/async.js:146:13)
- at Object.async.eachSeries (/home/lemb/Projects/wyzeio/node_modules/loopback-phase/node_modules/async/lib/async.js:162:9)
- at runHandlers (/home/lemb/Projects/wyzeio/node_modules/loopback-phase/lib/phase.js:144:13)
- at iterate (/home/lemb/Projects/wyzeio/node_modules/loopback-phase/node_modules/async/lib/async.js:146:13)
- at /home/lemb/Projects/wyzeio/node_modules/loopback-phase/node_modules/async/lib/async.js:157:25
- at /home/lemb/Projects/wyzeio/node_modules/loopback-phase/node_modules/async/lib/async.js:154:25
- at /home/lemb/Projects/wyzeio/node_modules/strong-remoting/lib/remote-objects.js:656:7
- at /home/lemb/Projects/wyzeio/node_modules/strong-remoting/lib/http-context.js:397:7
- at callback (/home/lemb/Projects/wyzeio/node_modules/strong-remoting/lib/shared-method.js:253:5)
- at /home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:377:19
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:121:5)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at ModelConstructor.<anonymous> (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:376:23)
- at ModelConstructor.next (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/hooks.js:81:12)
- at ModelConstructor.<anonymous> (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:364:26)
- at ModelConstructor.next (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/hooks.js:81:12)
- at /home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:363:22
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:121:5)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at createCallback (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:353:17)
- at /home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/lib/mongodb.js:346:7
- at /home/lemb/Projects/wyzeio/node_modules/async-listener/glue.js:188:31
- at _combinedTickCallback (internal/process/next_tick.js:67:7)
- at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:122:9)
- ✓ should return the AerialInspections (224ms)
- a form without defects
- A form was submitted without an installation mapped to the user
- ✓ should not send an email (68ms)
- when a form is submitted with defects
- A form was submitted without an installation mapped to the user
- Error sending defecting notification TypeError: Cannot read property 'id' of null
- at Role.findOne.then.role (/home/lemb/Projects/wyzeio/common/models/account.js:463:25)
- at /home/lemb/Projects/wyzeio/node_modules/async-listener/glue.js:188:31
- at _combinedTickCallback (internal/process/next_tick.js:67:7)
- at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:122:9)
- From previous event:
- at Function.Account.findAdmins (/home/lemb/Projects/wyzeio/common/models/account.js:468:8)
- at ModelConstructor.findAccountToEmailTo (/home/lemb/Projects/wyzeio/common/forms/aerial-inspection.js:71:10)
- at ModelConstructor.sendDefectEmail (/home/lemb/Projects/wyzeio/common/forms/aerial-inspection.js:58:16)
- at AerialInspection.afterRemote (/home/lemb/Projects/wyzeio/common/forms/aerial-inspection.js:17:14)
- at Function.<anonymous> (/home/lemb/Projects/wyzeio/node_modules/loopback/lib/model.js:216:18)
- at execStack (/home/lemb/Projects/wyzeio/node_modules/strong-remoting/lib/remote-objects.js:485:26)
- at RemoteObjects.execHooks (/home/lemb/Projects/wyzeio/node_modules/strong-remoting/lib/remote-objects.js:497:10)
- at phaseAfterInvoke (/home/lemb/Projects/wyzeio/node_modules/strong-remoting/lib/remote-objects.js:661:10)
- at runHandler (/home/lemb/Projects/wyzeio/node_modules/loopback-phase/lib/phase.js:135:5)
- at iterate (/home/lemb/Projects/wyzeio/node_modules/loopback-phase/node_modules/async/lib/async.js:146:13)
- at Object.async.eachSeries (/home/lemb/Projects/wyzeio/node_modules/loopback-phase/node_modules/async/lib/async.js:162:9)
- at runHandlers (/home/lemb/Projects/wyzeio/node_modules/loopback-phase/lib/phase.js:144:13)
- at iterate (/home/lemb/Projects/wyzeio/node_modules/loopback-phase/node_modules/async/lib/async.js:146:13)
- at /home/lemb/Projects/wyzeio/node_modules/loopback-phase/node_modules/async/lib/async.js:157:25
- at /home/lemb/Projects/wyzeio/node_modules/loopback-phase/node_modules/async/lib/async.js:154:25
- at /home/lemb/Projects/wyzeio/node_modules/strong-remoting/lib/remote-objects.js:656:7
- at /home/lemb/Projects/wyzeio/node_modules/strong-remoting/lib/http-context.js:397:7
- at callback (/home/lemb/Projects/wyzeio/node_modules/strong-remoting/lib/shared-method.js:253:5)
- at /home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:377:19
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:121:5)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at ModelConstructor.<anonymous> (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:376:23)
- at ModelConstructor.next (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/hooks.js:81:12)
- at ModelConstructor.<anonymous> (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:364:26)
- at ModelConstructor.next (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/hooks.js:81:12)
- at /home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:363:22
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at doNotify (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:98:49)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:121:5)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at Function.ObserverMixin._notifyBaseObservers (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:119:15)
- at Function.ObserverMixin.notifyObserversOf (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/observer.js:96:8)
- at createCallback (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:353:17)
- at /home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/lib/mongodb.js:346:7
- at /home/lemb/Projects/wyzeio/node_modules/async-listener/glue.js:188:31
- at _combinedTickCallback (internal/process/next_tick.js:67:7)
- at process._tickDomainCallback [as _tickCallback] (internal/process/next_tick.js:122:9)
- 8) should send an email
- Device
- API
- POST
- 9) "before all" hook
- PUT
- Error? { name: 'Error',
- status: 403,
- message: 'Access Denied',
- statusCode: 403,
- code: 'ACCESS_DENIED',
- stack: 'Error: Access Denied\n at /home/lemb/Projects/wyzeio/node_modules/loopback/lib/application.js:399:21\n at /home/lemb/Projects/wyzeio/node_modules/loopback/lib/model.js:322:7\n at /home/lemb/Projects/wyzeio/node_modules/loopback/common/models/acl.js:472:23\n at /home/lemb/Projects/wyzeio/node_modules/loopback/node_modules/async/dist/async.js:3694:9\n at /home/lemb/Projects/wyzeio/node_modules/loopback/node_modules/async/dist/async.js:356:16\n at iteratorCallback (/home/lemb/Projects/wyzeio/node_modules/loopback/node_modules/async/dist/async.js:936:13)\n at /home/lemb/Projects/wyzeio/node_modules/loopback/node_modules/async/dist/async.js:840:16\n at /home/lemb/Projects/wyzeio/node_modules/loopback/node_modules/async/dist/async.js:3691:13\n at apply (/home/lemb/Projects/wyzeio/node_modules/loopback/node_modules/async/dist/async.js:21:25)\n at /home/lemb/Projects/wyzeio/node_modules/loopback/node_modules/async/dist/async.js:56:12\n at /home/lemb/Projects/wyzeio/node_modules/loopback/common/models/acl.js:454:17\n at /home/lemb/Projects/wyzeio/node_modules/loopback/common/models/role.js:342:23\n at /home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:2011:62\n at /home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:1939:11\n at /home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/node_modules/async/lib/async.js:396:17\n at async.each (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/node_modules/async/lib/async.js:153:20)\n at _asyncMap (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/node_modules/async/lib/async.js:390:13)\n at Object.map (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/node_modules/async/lib/async.js:361:23)\n at allCb (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:1867:15)\n at /home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/lib/mongodb.js:895:9\n at handleCallback (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb/lib/utils.js:96:12)\n at /home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb/lib/cursor.js:839:16\n at handleCallback (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/cursor.js:159:5)\n at setCursorNotified (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/cursor.js:511:3)\n at /home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/cursor.js:582:16\n at queryCallback (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/cursor.js:220:18)\n at /home/lemb/Projects/wyzeio/node_modules/continuation-local-storage/context.js:84:17\n at bound (domain.js:280:14)\n at runBound (domain.js:293:12)\n at Callbacks.emit (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/topologies/server.js:119:3)\n at Connection.messageHandler (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/topologies/server.js:397:23)\n at Socket.<anonymous> (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/connection/connection.js:302:22)\n at emitOne (events.js:96:13)\n at Socket.emit (events.js:188:7)\n at readableAddChunk (_stream_readable.js:176:18)\n at Socket.Readable.push (_stream_readable.js:134:10)\n at TCP.onread (net.js:548:20)' }
- 10) should create a device
- Error? { name: 'Error',
- status: 403,
- message: 'Access Denied',
- statusCode: 403,
- code: 'ACCESS_DENIED',
- stack: 'Error: Access Denied\n at /home/lemb/Projects/wyzeio/node_modules/loopback/lib/application.js:399:21\n at /home/lemb/Projects/wyzeio/node_modules/loopback/lib/model.js:322:7\n at /home/lemb/Projects/wyzeio/node_modules/loopback/common/models/acl.js:472:23\n at /home/lemb/Projects/wyzeio/node_modules/loopback/node_modules/async/dist/async.js:3694:9\n at /home/lemb/Projects/wyzeio/node_modules/loopback/node_modules/async/dist/async.js:356:16\n at iteratorCallback (/home/lemb/Projects/wyzeio/node_modules/loopback/node_modules/async/dist/async.js:936:13)\n at /home/lemb/Projects/wyzeio/node_modules/loopback/node_modules/async/dist/async.js:840:16\n at /home/lemb/Projects/wyzeio/node_modules/loopback/node_modules/async/dist/async.js:3691:13\n at apply (/home/lemb/Projects/wyzeio/node_modules/loopback/node_modules/async/dist/async.js:21:25)\n at /home/lemb/Projects/wyzeio/node_modules/loopback/node_modules/async/dist/async.js:56:12\n at /home/lemb/Projects/wyzeio/node_modules/loopback/common/models/acl.js:454:17\n at /home/lemb/Projects/wyzeio/node_modules/loopback/common/models/role.js:342:23\n at /home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:2011:62\n at /home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:1939:11\n at /home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/node_modules/async/lib/async.js:396:17\n at async.each (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/node_modules/async/lib/async.js:153:20)\n at _asyncMap (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/node_modules/async/lib/async.js:390:13)\n at Object.map (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/node_modules/async/lib/async.js:361:23)\n at allCb (/home/lemb/Projects/wyzeio/node_modules/loopback-datasource-juggler/lib/dao.js:1867:15)\n at /home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/lib/mongodb.js:895:9\n at handleCallback (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb/lib/utils.js:96:12)\n at /home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb/lib/cursor.js:839:16\n at handleCallback (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/cursor.js:159:5)\n at setCursorNotified (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/cursor.js:511:3)\n at /home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/cursor.js:582:16\n at queryCallback (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/cursor.js:220:18)\n at /home/lemb/Projects/wyzeio/node_modules/continuation-local-storage/context.js:84:17\n at bound (domain.js:280:14)\n at runBound (domain.js:293:12)\n at Callbacks.emit (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/topologies/server.js:119:3)\n at Connection.messageHandler (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/topologies/server.js:397:23)\n at Socket.<anonymous> (/home/lemb/Projects/wyzeio/node_modules/loopback-connector-mongodb/node_modules/mongodb-core/lib/connection/connection.js:302:22)\n at emitOne (events.js:96:13)\n at Socket.emit (events.js:188:7)\n at readableAddChunk (_stream_readable.js:176:18)\n at Socket.Readable.push (_stream_readable.js:134:10)\n at TCP.onread (net.js:548:20)' }
- 11) should upsert when the device already exists
- when attempting to use another organization's device (macAddress)
- 12) POST / should fail with 409
- 13) PUT / should fail with 409
- 14) PUT /:id should fail with 404 (because you can't see /:id)
- PUT resource
- 15) should update the device resourceId
- GET include resource
- ✓ should retrieve a single resource
- Devices/:id
- ✓ should allow GET
- 16) should allow DELETE
- 17) should allow PUT for resourceId
- #type validation
- 18) shouldn't allow changing the type on PUT
- Devices/:id/getOdometer
- >>>> Stubbed geotab connector
- ✓ should return the odometer reading of the device (44ms)
- Event
- API
- ✓ PUT / should 404
- ✓ GET / should 404
- ✓ GET /findOne should 404
- ✓ GET /count should 404
- ✓ POST /update should 404
- ✓ GET /:id should 404
- ✓ DELETE /:id should 404
- ✓ PUT /:id should 404
- ✓ GET /:id/exists should 404
- ✓ POST /change-stream should 404
- POST
- ✓ should not crash on invalid coordinates
- ✓ should return an object `{id:""}` (43ms)
- "gps" event
- Apply completed 1
- ✓ should create an event
- "beacon-scan" event
- Apply completed 1
- ✓ should create an event
- ✓ should have updated the devices
- ✓ OLD >> should have updated the devices
- two scanner reporting SOS
- accessToken >> { ttl: 1209600,
- created: 2017-01-12T17:17:44.241Z,
- userId: 5877ba381ebfbb23196c254c,
- resourceId: '_5877ba381ebfbb23196c254d',
- organizationId: 'primary',
- id: '19684649584988' }
- Alert created without a scanner. macAddress: AAAAAAAA0123
- accessToken >> { ttl: 1209600,
- created: 2017-01-12T17:17:44.241Z,
- userId: 5877ba381ebfbb23196c254c,
- resourceId: '_5877ba381ebfbb23196c254d',
- organizationId: 'primary',
- id: '19684649584988' }
- ✓ should only create a single alert (1124ms)
- FormInstance
- API (/MyTestForms)
- No form module for my-test_form.js
- Swagger: skipping unknown type "GeoJSON.Point".
- Swagger: skipping unknown type "GeoJSON.Polygon".
- GET
- ✓ should expose MyTestForm instances (67ms)
- ✓ should expose MyTestForm by id
- POST
- A form was submitted without an installation mapped to the user
- ✓ should create an instance
- ✓ should set the submitter as the currently logged in user
- FormTemplate
- API
- GET
- ✓ should expose FormTemplates across organizations
- ✓ should expose FormTemplates by id
- Installations
- API
- POST
- ✓ should create an installation
- ✓ should create an associated device
- Job
- API (/Jobs/:id/worklogs)
- ✓ should be able to get the job
- 19) should be able to create
- Job
- API
- roles
- when logged in as foreman
- and not filtering
- ✓ should return all visible jobs
- and filtering on an acceptable projectId
- ✓ should return all jobs of the project
- and filtering on a projectId I don't have access too
- ✓ should not return any jobs
- and filtering on multiple projectIds
- ✓ should return jobs matching both filter and the projects subset
- and filtering on something else
- ✓ should only return job part of my projects (39ms)
- and counting jobs
- ✓ should return the count for job part of my projects
- and getting on /:id
- ✓ should return the job if in my projects
- ✓ should not return the job if not member of the project
- when logged in as admin (membership irrelevant)
- and not filtering
- 20) should return all jobs
- and filtering on an acceptable projectId
- 21) should return all jobs of the project
- and filtering on multiple projectIds
- 22) should return jobs matching both filter and the projects subset
- and filtering on something else
- 23) should return all matching jobs
- and counting jobs
- 24) should return the count all jobs matching
- and getting on /:id
- 25) should return the job if in my projects
- 26) should not return the job even if not member of the project
- /:id
- - should work as model
- - should return the job
- Presence
- API
- 27) requires a resourceId
- 28) requires a start
- 29) validates that end is greater than start
- 30) creates a presence for the specifed resource
- approvals
- ✓ should allow retrieiving the list of approvals
- ✓ should allow retrieiving the presences
- given a presence not yet approved
- ✓ should not be editable by regular users
- ✓ should not be approvable by regular users
- 31) should be L2 approvable by all Supervisors
- 32) should be L2 approvable by all Supervisors
- 33) should be L2 approvable by admin
- 34) should be editable by admin
- if the resource has a manager ("reportsTo")
- ✓ should not allow other foreman to approve
- 35) should allow the manager to approve
- if the resource has no manager ("reportsTo")
- 36) should allow other foreman to approve
- given a presence approved by a Foreman (L1)
- ✓ should not be approvable by other Foreman
- ✓ should not be editable by other Foreman
- ✓ should not be approvable by the approver
- 37) should be editable by the approver but update their approval date
- 38) should be approvable by supervisor/admin
- 39) should be editable by supervisor/admin but void the level 1 approval
- given a presence fully approved (L1 + L2)
- ✓ should not be approvable by the L1 approver
- ✓ should not be editable by the L1 approver
- ✓ should not be approvable by other L1 approver
- ✓ should not be editable by other approver
- ✓ should not be approvable by the L2 approver
- 40) should be editable by the L2 approver
- given a presence approved by a supervisor only (L2)
- ✓ should not be approvable by L1 approvers
- ✓ should not be editable by the L1 approver
- ✓ should not be approvable by other L2 approver
- ✓ should not be editable by other L2 approver
- ✓ should not be approvable by the L2 approver
- 41) should be editable by the L2 approver
- Project
- API
- when logged in as admin or project manager
- 42) should return all project
- 43) should return all project
- when logged in as foreman or supervisor
- ✓ should return projects that I'm a member of
- ✓ should return projects that I'm a member of
- includes
- ✓ should include jobs when required (42ms)
- ✓ should include members when requested (47ms)
- ✓ should include jobs, members, and members' resources when requested (49ms)
- backward compat for mobile
- ✓ should not break the previous mobile (67ms)
- Resource
- API
- strict schema
- 44) POST on /resources should fail with bad property
- 45) PUT on /resources/:id should fail with bad property
- /resources/:id
- given the resource comes from geotab
- 46) PUT should fail with 405
- 47) DELETE should fail with 405
- GET
- ✓ should return it
- given a resource of type "human"
- 48) PUT should update the resource
- filters
- ✓ should support fields and include filters simultaneously
- TenantOwned
- API
- /Owneds
- Swagger: skipping unknown type "GeoJSON.Point".
- Swagger: skipping unknown type "GeoJSON.Polygon".
- ✓ should inject the current organizationId on creation (81ms)
- ✓ should 401 if not logged in
- When not authenticated
- ✓ GET /JobCodes should 401 (find)
- ✓ POST /JobCodes should 401 (create)
- ✓ PUT /JobCodes should 404 (upsert)
- ✓ GET /JobCodes/count should 401 (count)
- ✓ GET /JobCodes/findOne should 401 (findOne)
- ✓ GET /JobCodes/:id should 401 (findById)
- ✓ DELETE /JobCodes/:id should 401 (deleteById)
- ✓ PUT /JobCodes/:id should 401 (prototype.updateAttributes)
- ✓ GET /JobCodes/:id/exists should 401 (exists)
- When authenticated to another organization as an admin
- ✓ GET /JobCodes should 200 (find)
- 49) POST /JobCodes should 200 (create)
- ✓ PUT /JobCodes should 404 (upsert)
- ✓ GET /JobCodes/count should 200 (count)
- ✓ GET /JobCodes/findOne should 404 (findOne)
- ✓ GET /JobCodes/:id should 404 (findById)
- 50) DELETE /JobCodes/:id should 404 (deleteById)
- 51) PUT /JobCodes/:id should 404 (prototype.updateAttributes)
- ✓ GET /JobCodes/:id/exists should 200 (exists)
- When authenticated to a organization as an admin
- ✓ GET /JobCodes should 200 (find)
- 52) POST /JobCodes should 200 (create)
- ✓ PUT /JobCodes should 404 (upsert)
- ✓ GET /JobCodes/count should 200 (count)
- ✓ GET /JobCodes/findOne should 200 (findOne)
- ✓ GET /JobCodes/:id should 200 (findById)
- 53) DELETE /JobCodes/:id should 200 (deleteById)
- 54) PUT /JobCodes/:id should 200 (prototype.updateAttributes)
- ✓ GET /JobCodes/:id/exists should 200 (exists)
- Embedded model update
- 55) should support organizationId injection in embedded model update
- WorkLog
- API
- ✓ should require a jobId
- ✓ should require a resourceId
- changing job
- 56) should be possible to update the "jobId" only
- approvals
- ✓ should allow retrieiving the list of approvals
- ✓ should allow retrieiving the worklogs (83ms)
- given a worklog not yet approved
- ✓ should not be editable by regular users
- ✓ should not be approvable by regular users
- 57) should be L2 approvable by all Supervisors
- 58) should be L2 approvable by all Supervisors
- 59) should be L2 approvable by admin
- 60) should be editable by admin
- if the resource has a manager ("reportsTo")
- ✓ should not allow other foreman to approve
- 61) should allow the manager to approve
- if the resource has no manager ("reportsTo")
- 62) should allow other foreman to approve
- given a worklog approved by a Foreman (L1)
- ✓ should not be approvable by other Foreman
- ✓ should not be editable by other Foreman
- ✓ should not be approvable by the approver
- 63) should be editable by the approver but update their approval date
- 64) should be approvable by supervisor/admin
- 65) should be editable by supervisor/admin but void the level 1 approval
- given a worklog fully approved (L1 + L2)
- ✓ should not be approvable by the L1 approver
- ✓ should not be editable by the L1 approver
- ✓ should not be approvable by other L1 approver
- ✓ should not be editable by other approver
- ✓ should not be approvable by the L2 approver
- 66) should be editable by the L2 approver
- given a worklog approved by a supervisor only (L2)
- ✓ should not be approvable by L1 approvers
- ✓ should not be editable by the L1 approver
- ✓ should not be approvable by other L2 approver
- ✓ should not be editable by other L2 approver
- ✓ should not be approvable by the L2 approver
- 67) should be editable by the L2 approver
- backward compatibility using firstApprovalById
- 68) should support approving with firstApprovalById
- Change job and project
- 69) should allow changing the job of the worklog and apply correct projectId
- UI Bug
- 70) should work when doing it twice in a row
- Bootstrap (Setup)
- chai.should
- ✓ should be available
- chai-datetime
- ✓ should be available
- sinon & sinon-chai
- ✓ should be able to spy
- ✓ should be able to catch errors
- chai-as-promised
- ✓ should add .become and eventually
- AerialInspection
- Forms
- #hasDefects
- ✓ should be false when there are no defects
- ✓ should be true when there are defects
- geojson
- position
- ✓ should return a position equivvalent to the one its invoked with
- ✓ should validate longitude and latitude as number
- ✓ should validate longitude is between [-180, 180]
- ✓ should validate latitude is between [-90, 90]
- ✓ should have a toGeoPoint method that returns {lng, lat}
- Point
- ✓ should return a Point instance
- ✓ should support instantiation without new
- ✓ should accept a Point
- ✓ should accept a position as argument
- ✓ should default to type "Point"
- ✓ should fail when passing type other than "Point"
- ✓ should have a toGeoPoint method that returns {lng, lat}
- MultiPoint
- ✓ should work when the array is correctly formated
- ✓ should required a length of 1 position
- ✓ should use position
- Polygon
- ✓ should work when the array is correctly formated
- ✓ should fail when a ring is not closed
- ✓ should fail when a ring has less than 4 positions
- MultiLineString
- ✓ should work when the array is correctly formated
- MultiPolygon
- ✓ should work when the array is correctly formated
- JSON serialization
- ✓ should only include "type" and "coordinates"
- Duration
- Swagger: skipping unknown type "GeoJSON.Point".
- Swagger: skipping unknown type "GeoJSON.Polygon".
- properties
- ✓ should have Duration properties
- computed third value
- ✓ should compute the duration when settings start and end
- ✓ should compute the start when settings duration and end
- ✓ should compute the end when settings start and duration
- validation
- ✓ should be valid
- internal consistency
- ✓ should not be valid when start + duration !== end
- duration as positive int
- ✓ should be valid with number 1
- ✓ should be valid with number 45
- ✓ should not be valid with number -2
- ✓ should not be valid with number 3.2
- ✓ should not be valid with number 0
- ✓ should not be valid with object [object Object]
- ✓ should not be valid with string Jim
- require at least 2 properties
- ✓ should be valid with values for start,duration,end
- ✓ should be valid with values for start,end
- ✓ should be valid with values for start,duration
- ✓ should be valid with values for duration,end
- ✓ should not be valid with values for start
- ✓ should not be valid with values for end
- ✓ should not be valid with values for duration
- ✓ should not be valid with values for nothing
- EnumValidationMixin
- ✓ should be valid when value is in the enum
- ✓ should be invalid when value is outside the enum
- Located
- mixin
- Swagger: skipping unknown type "GeoJSON.Point".
- properties
- Swagger: skipping unknown type "GeoJSON.Polygon".
- ✓ should have a "location" property
- ✓ should have a "locationUpdatedAt" property
- #makeLocationUpdate(location, {timestamp, centerWithCurrent})
- ✓ should throw when no location
- given no options:
- ✓ should return an update matching the location
- given no options.timestamp
- ✓ should return an update matching the location when {centerWithCurrent:false}
- - [REMOVED] (until proper location averaging) should return an update that is the center of matching the location when {centerWithCurrent:true}
- ✓ should return an update matching the location when located.location is null
- given options.timestamp
- ✓ should return null when location is expired
- ✓ should return an update matching location when located.location is expired
- - [REMOVED] (until proper location averaging) should return an update at the center when both lcoations are valid and centerWithCurrent is true
- mixins
- ReadOnly
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement