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
d5ff74a1
Commit
d5ff74a1
authored
Jan 17, 2017
by
iivic
Committed by
Ivan Ivic
Jan 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SOL-2194] Bug fix TypeError: seatData is undefined
parent
364b96f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletions
+18
-1
ecommerce/static/js/test/specs/views/coupon_form_view_spec.js
+15
-0
ecommerce/static/js/views/coupon_form_view.js
+3
-1
No files found.
ecommerce/static/js/test/specs/views/coupon_form_view_spec.js
View file @
d5ff74a1
...
@@ -80,6 +80,21 @@ define([
...
@@ -80,6 +80,21 @@ define([
expect
(
view
.
updateTotalValue
).
toHaveBeenCalled
();
expect
(
view
.
updateTotalValue
).
toHaveBeenCalled
();
expect
(
view
.
getSeatData
).
toHaveBeenCalled
();
expect
(
view
.
getSeatData
).
toHaveBeenCalled
();
});
});
it
(
'should call updateTotalValue when catalog_type "Single course"'
,
function
()
{
spyOn
(
view
,
'updateTotalValue'
);
view
.
changeTotalValue
();
expect
(
view
.
updateTotalValue
).
toHaveBeenCalled
();
expect
(
view
.
model
.
get
(
'catalog_type'
)).
toBe
(
'Single course'
);
});
it
(
'should not call updateTotalValue when catalog_type not "Single course"'
,
function
()
{
spyOn
(
view
,
'updateTotalValue'
);
view
.
model
.
set
(
'catalog_type'
,
'Not single course'
);
view
.
changeTotalValue
();
expect
(
view
.
updateTotalValue
).
not
.
toHaveBeenCalled
();
expect
(
view
.
model
.
get
(
'catalog_type'
)).
not
.
toBe
(
'Single course'
);
});
});
});
describe
(
'enrollment code'
,
function
()
{
describe
(
'enrollment code'
,
function
()
{
...
...
ecommerce/static/js/views/coupon_form_view.js
View file @
d5ff74a1
...
@@ -572,7 +572,9 @@ define([
...
@@ -572,7 +572,9 @@ define([
},
},
changeTotalValue
:
function
()
{
changeTotalValue
:
function
()
{
this
.
updateTotalValue
(
this
.
getSeatData
());
if
(
this
.
model
.
get
(
'catalog_type'
)
===
'Single course'
&&
this
.
getSeatType
()
!==
null
)
{
this
.
updateTotalValue
(
this
.
getSeatData
());
}
},
},
updateTotalValue
:
function
(
seatData
)
{
updateTotalValue
:
function
(
seatData
)
{
...
...
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