Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 8ecbf2a

Browse files
author
vikasrohit
committed
AS#141842509742941, Fix unit tests for submission.service.js 
-- Fixed
1 parent bdbdcea commit 8ecbf2a

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

app/submissions/submit-design-files/submit-design-files.spec.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ describe('Submit Design Files Controller', function() {
1919
}
2020

2121
var submissionsService = {
22-
getPresignedURL: function() {}
22+
getPresignedURL: function() {},
23+
startSubmission: function() {
24+
var deferred = $q.defer()
25+
deferred.resolve()
26+
return deferred.promise
27+
}
2328
}
2429

2530
var mockWindow = {
@@ -30,7 +35,7 @@ describe('Submit Design Files Controller', function() {
3035

3136
beforeEach(function() {
3237
bard.appModule('tc.submissions')
33-
bard.inject(this, '$controller', '$rootScope')
38+
bard.inject(this, '$controller', '$rootScope', '$q')
3439

3540
scope = $rootScope.$new()
3641
})
@@ -59,7 +64,7 @@ describe('Submit Design Files Controller', function() {
5964
challengeToSubmitTo: {
6065
challenge: {
6166
name: 'Challenge Name',
62-
track: 'DEVELOP',
67+
track: 'DESIGN',
6368
id: 30049240
6469
}
6570
},
@@ -127,7 +132,7 @@ describe('Submit Design Files Controller', function() {
127132
})
128133
})
129134

130-
describe.skip('uploadSubmission', function() {
135+
describe('uploadSubmission', function() {
131136
it('adds comments to the submissions body', function() {
132137
vm.comments = 'test comments'
133138
scope.$digest()
@@ -149,7 +154,7 @@ describe('Submit Design Files Controller', function() {
149154
})
150155

151156
it('calls the submission service', function() {
152-
var mockAPICall = sinon.spy(submissionsService, 'getPresignedURL')
157+
var mockAPICall = sinon.spy(submissionsService, 'startSubmission')
153158

154159
vm.uploadSubmission()
155160
scope.$digest()

app/submissions/submit-develop-files/submit-develop-files.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*eslint no-undef:0*/
2-
describe.skip('Submit Develop Files Controller', function() {
2+
describe('Submit Develop Files Controller', function() {
33
var controller, vm, scope
44

55
var mockChallenge = {
@@ -59,7 +59,7 @@ describe.skip('Submit Develop Files Controller', function() {
5959
challengeToSubmitTo: {
6060
challenge: {
6161
name: 'Challenge Name',
62-
track: 'DESIGN',
62+
track: 'DEVELOP',
6363
id: 30049240
6464
}
6565
},

0 commit comments

Comments
 (0)