Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
39f81df4
Commit
39f81df4
authored
May 13, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a few more tests for feedback models
parent
e440580c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
2 deletions
+43
-2
cms/static/coffee/spec/models/feedback_spec.coffee
+43
-2
No files found.
cms/static/coffee/spec/models/feedback_spec.coffee
View file @
39f81df4
describe
"CMS.Models.SystemFeedback"
,
->
m
=
new
CMS
.
Models
.
SystemFeedback
()
beforeEach
->
@
model
=
new
CMS
.
Models
.
SystemFeedback
()
it
"should have an empty message by default"
,
->
expect
(
m
.
get
(
"message"
)).
toEqual
(
""
)
expect
(
@
model
.
get
(
"message"
)).
toEqual
(
""
)
it
"should have an empty title by default"
,
->
expect
(
@
model
.
get
(
"title"
)).
toEqual
(
""
)
it
"should not have a type set by default"
,
->
expect
(
@
model
.
get
(
"type"
)).
toBeNull
()
it
"should be shown by default"
,
->
expect
(
@
model
.
get
(
"shown"
)).
toEqual
(
true
)
it
"should trigger a change event on calling .hide()"
,
->
spy
=
jasmine
.
createSpy
()
@
model
.
on
(
"change"
,
spy
)
@
model
.
hide
()
expect
(
@
model
.
get
(
"shown"
)).
toEqual
(
false
)
expect
(
spy
).
toHaveBeenCalled
()
describe
"CMS.Models.WarningMessage"
,
->
beforeEach
->
@
model
=
new
CMS
.
Models
.
WarningMessage
()
it
"should have the correct type"
,
->
expect
(
@
model
.
get
(
"type"
)).
toEqual
(
"warning"
)
describe
"CMS.Models.ErrorMessage"
,
->
beforeEach
->
@
model
=
new
CMS
.
Models
.
ErrorMessage
()
it
"should have the correct type"
,
->
expect
(
@
model
.
get
(
"type"
)).
toEqual
(
"error"
)
describe
"CMS.Models.ConfirmationMessage"
,
->
beforeEach
->
@
model
=
new
CMS
.
Models
.
ConfirmationMessage
()
it
"should have the correct type"
,
->
expect
(
@
model
.
get
(
"type"
)).
toEqual
(
"confirmation"
)
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