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

Commit cdb2730

Browse files
author
Nick Litwin
committed
Fix tests
1 parent 9233e3a commit cdb2730

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

app/submissions/submissions.spec.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ describe('Submissions Controller', function() {
33
var controller;
44
var vm;
55

6-
// var mockSubmissions = mockData.getMockSubmissions();
6+
var mockChallenge = {
7+
challenge: {
8+
name: 'Challenge Name',
9+
track: 'DESIGN',
10+
id: 30049240
11+
}
12+
};
713

814
beforeEach(function() {
915
bard.appModule('tc.submissions');
@@ -13,7 +19,9 @@ describe('Submissions Controller', function() {
1319
bard.verifyNoOutstandingHttpRequests();
1420

1521
beforeEach(function() {
16-
controller = $controller('SubmissionsController', {});
22+
controller = $controller('SubmissionsController', {
23+
challengeToSubmitTo: mockChallenge
24+
});
1725
vm = controller;
1826
});
1927

app/submissions/submit-file/submit-file.spec.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@ describe('Submit File Controller', function() {
33
var controller;
44
var vm;
55

6+
var mockChallenge = {
7+
challenge: {
8+
name: 'Challenge Name',
9+
track: 'DESIGN',
10+
id: 30049240
11+
}
12+
};
13+
14+
userService = {
15+
getUserIdentity: function() {
16+
return {
17+
userId: 123456
18+
};
19+
}
20+
};
21+
622
beforeEach(function() {
723
bard.appModule('tc.submissions');
824
bard.inject(this, '$controller');
@@ -11,12 +27,14 @@ describe('Submit File Controller', function() {
1127
bard.verifyNoOutstandingHttpRequests();
1228

1329
beforeEach(function() {
14-
controller = $controller('SubmitFileController', {});
30+
controller = $controller('SubmitFileController', {
31+
UserService: userService,
32+
challengeToSubmitTo: mockChallenge
33+
});
1534
vm = controller;
1635
});
1736

1837
it('should exist', function() {
1938
expect(vm).to.exist;
20-
expect(vm.submitFile).to.be.true;
2139
});
2240
});

0 commit comments

Comments
 (0)