Skip to content

Commit a9169df

Browse files
committed
Cleanup ordes spec, removes unnecessary compile (as its a componet)
Remove excessive digest from resource details spec, renamed (as compile isn't the building mechanism)
1 parent c6fd5ad commit a9169df

File tree

2 files changed

+10
-23
lines changed

2 files changed

+10
-23
lines changed

client/app/orders/order-explorer/order-explorer.component.spec.js

+8-20
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,6 @@ describe('Component: orderExplorer', () => {
55
module('app.states', 'app.orders')
66
})
77

8-
describe('with $compile', () => {
9-
let scope
10-
let element
11-
12-
beforeEach(inject(function ($compile, $rootScope) {
13-
bard.inject('$state')
14-
15-
scope = $rootScope.$new()
16-
element = angular.element('<order-explorer />')
17-
$compile(element)(scope)
18-
19-
scope.$apply()
20-
}))
21-
22-
it('should work with $state.go', () => {
23-
$state.go('orders')
24-
expect($state.is('orders.explorer'))
25-
})
26-
})
27-
288
describe('with $componentController', () => {
299
let scope
3010
let ctrl
@@ -36,6 +16,14 @@ describe('Component: orderExplorer', () => {
3616
it('is defined', () => {
3717
expect(ctrl).to.be.defined
3818
})
19+
20+
it('should work with $state.go', () => {
21+
bard.inject('$state')
22+
23+
$state.go('orders')
24+
expect($state.is('orders.explorer'))
25+
})
26+
3927
it('is can report back a request state', () => {
4028
const item = {
4129
request_state: 'finished',

client/app/services/resource-details/resource-details.component.spec.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ describe('Component: Resource Details', () => {
88
let scope, state, vmSpy, vmData, ctrl, vmPermissions
99
let mockDir = 'tests/mock/services/'
1010

11-
describe('with $compile', () => {
12-
beforeEach(inject(($stateParams, $compile, $rootScope, $componentController) => {
11+
describe('with $componentController', () => {
12+
beforeEach(inject(($stateParams, $rootScope, $componentController) => {
1313
scope = $rootScope.$new()
1414
$stateParams.vmId = '12345'
1515
bard.inject('VmsService', 'PowerOperations', 'sprintf', 'lodash', 'EventNotifications',
@@ -32,7 +32,6 @@ describe('Component: Resource Details', () => {
3232
})
3333

3434
ctrl.$onInit()
35-
scope.$digest()
3635
}))
3736
it('should be able perform power operations on a VM', () => {
3837
vmSpy = sinon.stub(VmsService, 'getVm').returns(Promise.resolve(vmData))

0 commit comments

Comments
 (0)