Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ecommerce
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
ecommerce
Commits
18f7315a
Commit
18f7315a
authored
Aug 18, 2015
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #285 from edx/clintonb/test-wrap
Properly wrapping tests
parents
1096ba34
1cd050f9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
1 deletions
+20
-1
ecommerce/static/js/test/specs/collections/course_collection_spec.js
+2
-0
ecommerce/static/js/test/specs/models/course_model_spec.js
+2
-0
ecommerce/static/js/test/specs/models/course_seats/course_seat_spec.js
+2
-0
ecommerce/static/js/test/specs/models/product_model_spec.js
+2
-0
ecommerce/static/js/test/specs/utils/course_utils_spec.js
+2
-0
ecommerce/static/js/test/specs/utils/utils_spec.js
+2
-0
ecommerce/static/js/test/specs/views/course_seat_form_fields/course_seat_form_field_view_spec.js
+2
-0
ecommerce/static/js/test/specs/views/course_seat_form_fields/professional_course_seat_form_field_view_spec.js
+4
-1
ecommerce/static/js/test/specs/views/course_seat_form_fields/verified_seat_form_field_view_spec.js
+2
-0
No files found.
ecommerce/static/js/test/specs/collections/course_collection_spec.js
View file @
18f7315a
...
@@ -25,6 +25,7 @@ define([
...
@@ -25,6 +25,7 @@ define([
collection
=
new
CourseCollection
();
collection
=
new
CourseCollection
();
});
});
describe
(
'Course collection'
,
function
()
{
describe
(
'parse'
,
function
()
{
describe
(
'parse'
,
function
()
{
it
(
'should return the results list in the response'
,
function
()
{
it
(
'should return the results list in the response'
,
function
()
{
expect
(
collection
.
parse
(
response
)).
toEqual
(
response
.
results
);
expect
(
collection
.
parse
(
response
)).
toEqual
(
response
.
results
);
...
@@ -39,5 +40,6 @@ define([
...
@@ -39,5 +40,6 @@ define([
expect
(
collection
.
fetch
).
toHaveBeenCalledWith
({
remove
:
false
});
expect
(
collection
.
fetch
).
toHaveBeenCalledWith
({
remove
:
false
});
});
});
});
});
});
}
}
);
);
ecommerce/static/js/test/specs/models/course_model_spec.js
View file @
18f7315a
...
@@ -98,6 +98,7 @@ define([
...
@@ -98,6 +98,7 @@ define([
model
=
Course
.
findOrCreate
(
data
,
{
parse
:
true
});
model
=
Course
.
findOrCreate
(
data
,
{
parse
:
true
});
});
});
describe
(
'Course model'
,
function
()
{
describe
(
'removeParentProducts'
,
function
()
{
describe
(
'removeParentProducts'
,
function
()
{
it
(
'should remove all parent products from the products collection'
,
function
()
{
it
(
'should remove all parent products from the products collection'
,
function
()
{
var
products
=
model
.
get
(
'products'
);
var
products
=
model
.
get
(
'products'
);
...
@@ -217,5 +218,6 @@ define([
...
@@ -217,5 +218,6 @@ define([
expect
(
model
.
get
(
'products'
)).
toEqual
(
jasmine
.
any
(
ProductCollection
));
expect
(
model
.
get
(
'products'
)).
toEqual
(
jasmine
.
any
(
ProductCollection
));
});
});
});
});
});
}
}
);
);
ecommerce/static/js/test/specs/models/course_seats/course_seat_spec.js
View file @
18f7315a
...
@@ -36,6 +36,7 @@ define([
...
@@ -36,6 +36,7 @@ define([
model
=
CourseSeat
.
findOrCreate
(
data
,
{
parse
:
true
});
model
=
CourseSeat
.
findOrCreate
(
data
,
{
parse
:
true
});
});
});
describe
(
'Course seat model'
,
function
()
{
describe
(
'getSeatType'
,
function
()
{
describe
(
'getSeatType'
,
function
()
{
it
(
'should return a seat type corresponding to the certificate type'
,
function
()
{
it
(
'should return a seat type corresponding to the certificate type'
,
function
()
{
var
mappings
=
{
var
mappings
=
{
...
@@ -113,5 +114,6 @@ define([
...
@@ -113,5 +114,6 @@ define([
});
});
});
});
});
});
});
}
}
);
);
ecommerce/static/js/test/specs/models/product_model_spec.js
View file @
18f7315a
...
@@ -36,6 +36,7 @@ define([
...
@@ -36,6 +36,7 @@ define([
model
=
Product
.
findOrCreate
(
data
,
{
parse
:
true
});
model
=
Product
.
findOrCreate
(
data
,
{
parse
:
true
});
});
});
describe
(
'Product model'
,
function
()
{
// NOTE (CCB): There is a bug preventing this from being called 'toJSON'.
// NOTE (CCB): There is a bug preventing this from being called 'toJSON'.
// See https://github.com/karma-runner/karma/issues/1534.
// See https://github.com/karma-runner/karma/issues/1534.
describe
(
'#toJSON'
,
function
()
{
describe
(
'#toJSON'
,
function
()
{
...
@@ -72,5 +73,6 @@ define([
...
@@ -72,5 +73,6 @@ define([
expect
(
json
.
attribute_values
).
toEqual
(
data
.
attribute_values
);
expect
(
json
.
attribute_values
).
toEqual
(
data
.
attribute_values
);
});
});
});
});
});
}
}
);
);
ecommerce/static/js/test/specs/utils/course_utils_spec.js
View file @
18f7315a
...
@@ -16,6 +16,7 @@ define([
...
@@ -16,6 +16,7 @@ define([
VerifiedSeat
)
{
VerifiedSeat
)
{
'use strict'
;
'use strict'
;
describe
(
'CourseUtils'
,
function
()
{
describe
(
'getCourseSeatModel'
,
function
()
{
describe
(
'getCourseSeatModel'
,
function
()
{
it
(
'should return the CourseSeat child class corresponding to a seat type'
,
function
()
{
it
(
'should return the CourseSeat child class corresponding to a seat type'
,
function
()
{
expect
(
CourseUtils
.
getCourseSeatModel
(
'audit'
)).
toEqual
(
AuditSeat
);
expect
(
CourseUtils
.
getCourseSeatModel
(
'audit'
)).
toEqual
(
AuditSeat
);
...
@@ -41,5 +42,6 @@ define([
...
@@ -41,5 +42,6 @@ define([
});
});
});
});
});
});
});
}
}
);
);
ecommerce/static/js/test/specs/utils/utils_spec.js
View file @
18f7315a
...
@@ -4,6 +4,7 @@ define([
...
@@ -4,6 +4,7 @@ define([
function
(
Utils
)
{
function
(
Utils
)
{
'use strict'
;
'use strict'
;
describe
(
'Utils'
,
function
()
{
describe
(
'stripTimezone'
,
function
()
{
describe
(
'stripTimezone'
,
function
()
{
it
(
'should return the input value if the input is empty'
,
function
()
{
it
(
'should return the input value if the input is empty'
,
function
()
{
expect
(
Utils
.
stripTimezone
(
''
)).
toEqual
(
''
);
expect
(
Utils
.
stripTimezone
(
''
)).
toEqual
(
''
);
...
@@ -29,5 +30,6 @@ define([
...
@@ -29,5 +30,6 @@ define([
expect
(
Utils
.
restoreTimezone
(
dt
)).
toEqual
(
dt
+
'+00:00'
);
expect
(
Utils
.
restoreTimezone
(
dt
)).
toEqual
(
dt
+
'+00:00'
);
});
});
});
});
});
}
}
);
);
ecommerce/static/js/test/specs/views/course_seat_form_fields/course_seat_form_field_view_spec.js
View file @
18f7315a
...
@@ -13,11 +13,13 @@ define([
...
@@ -13,11 +13,13 @@ define([
view
=
new
CourseSeatFormFieldView
({
model
:
model
});
view
=
new
CourseSeatFormFieldView
({
model
:
model
});
});
});
describe
(
'course seat form field view'
,
function
()
{
describe
(
'cleanIdVerificationRequired'
,
function
()
{
describe
(
'cleanIdVerificationRequired'
,
function
()
{
it
(
'should always return a boolean'
,
function
()
{
it
(
'should always return a boolean'
,
function
()
{
expect
(
view
.
cleanIdVerificationRequired
(
'false'
)).
toEqual
(
false
);
expect
(
view
.
cleanIdVerificationRequired
(
'false'
)).
toEqual
(
false
);
expect
(
view
.
cleanIdVerificationRequired
(
'true'
)).
toEqual
(
true
);
expect
(
view
.
cleanIdVerificationRequired
(
'true'
)).
toEqual
(
true
);
});
});
});
});
});
}
}
);
);
ecommerce/static/js/test/specs/views/course_seat_form_fields/professional_course_seat_form_field_view_spec.js
View file @
18f7315a
...
@@ -13,6 +13,7 @@ define([
...
@@ -13,6 +13,7 @@ define([
view
=
new
CourseSeatFormFieldView
({
model
:
model
}).
render
();
view
=
new
CourseSeatFormFieldView
({
model
:
model
}).
render
();
});
});
describe
(
'professional course seat form field view'
,
function
()
{
describe
(
'getFieldValue'
,
function
()
{
describe
(
'getFieldValue'
,
function
()
{
it
(
'should return a boolean if the name is id_verification_required'
,
function
()
{
it
(
'should return a boolean if the name is id_verification_required'
,
function
()
{
// NOTE (CCB): Ideally _.each should be used here to loop over an array of Boolean values.
// NOTE (CCB): Ideally _.each should be used here to loop over an array of Boolean values.
...
@@ -26,10 +27,12 @@ define([
...
@@ -26,10 +27,12 @@ define([
expect
(
view
.
getFieldValue
(
'id_verification_required'
)).
toEqual
(
true
);
expect
(
view
.
getFieldValue
(
'id_verification_required'
)).
toEqual
(
true
);
});
});
// NOTE (CCB): This test is flaky (hence it being skipped). Occasionally, calls to the parent class fail.
// NOTE (CCB): This test is flaky (hence it being skipped).
// Occasionally, calls to the parent class fail.
xit
(
'should always return professional if the name is certificate_type'
,
function
()
{
xit
(
'should always return professional if the name is certificate_type'
,
function
()
{
expect
(
view
.
getFieldValue
(
'certificate_type'
)).
toEqual
(
'professional'
);
expect
(
view
.
getFieldValue
(
'certificate_type'
)).
toEqual
(
'professional'
);
});
});
});
});
});
}
}
);
);
ecommerce/static/js/test/specs/views/course_seat_form_fields/verified_seat_form_field_view_spec.js
View file @
18f7315a
...
@@ -13,6 +13,7 @@ define([
...
@@ -13,6 +13,7 @@ define([
view
=
new
VerifiedCourseSeatFormFieldView
({
model
:
model
}).
render
();
view
=
new
VerifiedCourseSeatFormFieldView
({
model
:
model
}).
render
();
});
});
describe
(
'verified course seat form field view'
,
function
()
{
describe
(
'getData'
,
function
()
{
describe
(
'getData'
,
function
()
{
it
(
'should return the data from the DOM/model'
,
function
()
{
it
(
'should return the data from the DOM/model'
,
function
()
{
var
data
=
{
var
data
=
{
...
@@ -25,5 +26,6 @@ define([
...
@@ -25,5 +26,6 @@ define([
expect
(
view
.
getData
()).
toEqual
(
data
);
expect
(
view
.
getData
()).
toEqual
(
data
);
});
});
});
});
});
}
}
);
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment