Add tests for the enrollment_interface

This commit is contained in:
Diana Huang
2014-10-30 14:00:44 -04:00
parent fc468bf696
commit 47979e5bcf
3 changed files with 16 additions and 5 deletions

View File

@@ -260,7 +260,10 @@
exports: 'NotificationView',
deps: ['backbone', 'jquery', 'underscore']
},
'js/student_account/enrollment_interface': {
exports: 'js/student_account/enrollment_interface',
deps: ['jquery', 'underscore', 'gettext']
},
// Student account registration/login
// Loaded explicitly until these are converted to RequireJS
'js/student_account/views/FormView': {
@@ -310,7 +313,7 @@
'js/student_account/views/RegisterView',
'underscore.string'
]
},
}
},
});
@@ -327,6 +330,7 @@
'lms/include/js/spec/student_account/login_spec.js',
'lms/include/js/spec/student_account/register_spec.js',
'lms/include/js/spec/student_account/password_reset_spec.js',
'lms/include/js/spec/student_account/enrollment_interface_spec.js',
'lms/include/js/spec/student_profile/profile.js',
]);

View File

@@ -1,5 +1,5 @@
define(['js/common_helpers/template_helpers', 'js/student_account/views/AccessView'],
function(TemplateHelpers) {
function(TemplateHelpers, AccessView) {
describe('edx.student.account.AccessView', function() {
'use strict';

View File

@@ -1,14 +1,21 @@
define(['js/common_helpers/template_helpers', 'js/student_account/enrollment_interface'],
function(TemplateHelpers) {
function(TemplateHelpers, EnrollmentInterface) {
describe("edx.student.account.EnrollmentInterface", function() {
'use strict';
it("find course modes using modeInArray ", function() {
var course_modes = [
{
slug: 'honor'
},
{
slug: 'professional'
}
];
],
expect(EnrollmentInterface.modeInArray('professional')).toBe(true);
expect(EnrollmentInterface.modeInArray('audit')).toBe(false);
});
});
}