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
ed20d5a1
Commit
ed20d5a1
authored
Jan 28, 2015
by
Jonathan Piacenti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inverted boolean for rendering in CheckVisible.
parent
bd57d56b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
common/static/coffee/spec/discussion/view/new_post_view_spec.coffee
+12
-12
No files found.
common/static/coffee/spec/discussion/view/new_post_view_spec.coffee
View file @
ed20d5a1
...
...
@@ -10,8 +10,8 @@ describe "NewPostView", ->
)
@
discussion
=
new
Discussion
([],
{
pages
:
1
})
checkVisibility
=
(
view
,
expectedVisible
,
expectedDisabled
,
noR
ender
)
=>
if
!
noR
ender
checkVisibility
=
(
view
,
expectedVisible
,
expectedDisabled
,
r
ender
)
=>
if
r
ender
view
.
render
()
# Can also be undefined if the element does not exist.
expect
(
view
.
$
(
'.group-selector-wrapper'
).
is
(
":visible"
)
or
false
).
toEqual
(
expectedVisible
)
...
...
@@ -51,28 +51,28 @@ describe "NewPostView", ->
)
it
"is not visible to students"
,
->
checkVisibility
(
@
view
,
false
)
checkVisibility
(
@
view
,
false
,
false
,
true
)
it
"allows TAs to see the cohort selector"
,
->
DiscussionSpecHelper
.
makeTA
()
checkVisibility
(
@
view
,
true
)
checkVisibility
(
@
view
,
true
,
false
,
true
)
it
"allows moderators to see the cohort selector"
,
->
DiscussionSpecHelper
.
makeModerator
()
checkVisibility
(
@
view
,
true
)
checkVisibility
(
@
view
,
true
,
false
,
true
)
it
"only enables the cohort selector when applicable"
,
->
DiscussionSpecHelper
.
makeModerator
()
# We start on the cohorted discussion
checkVisibility
(
@
view
,
true
)
checkVisibility
(
@
view
,
true
,
false
,
true
)
# Select the uncohorted topic
$
(
'.topic-title:contains(General)'
).
click
()
# The menu should now be visible but disabled.
checkVisibility
(
@
view
,
true
,
true
,
tru
e
)
checkVisibility
(
@
view
,
true
,
true
,
fals
e
)
# Select the cohorted topic again
$
(
'.topic-title:contains(Topic)'
).
click
()
# It should be visible and enabled once more.
checkVisibility
(
@
view
,
true
,
false
,
tru
e
)
checkVisibility
(
@
view
,
true
,
false
,
fals
e
)
it
"allows the user to make a cohort selection"
,
->
DiscussionSpecHelper
.
makeModerator
()
...
...
@@ -119,20 +119,20 @@ describe "NewPostView", ->
it
"disables the cohort menu if it is set false"
,
->
DiscussionSpecHelper
.
makeModerator
()
@
view
.
is_commentable_cohorted
=
false
checkVisibility
(
@
view
,
true
,
true
)
checkVisibility
(
@
view
,
true
,
true
,
true
)
it
"enables the cohort menu if it is set true"
,
->
DiscussionSpecHelper
.
makeModerator
()
@
view
.
is_commentable_cohorted
=
true
checkVisibility
(
@
view
,
true
)
checkVisibility
(
@
view
,
true
,
false
,
true
)
it
"is not visible to students when set false"
,
->
@
view
.
is_commentable_cohorted
=
false
checkVisibility
(
@
view
,
false
)
checkVisibility
(
@
view
,
false
,
false
,
true
)
it
"is not visible to students when set true"
,
->
@
view
.
is_commentable_cohorted
=
true
checkVisibility
(
@
view
,
false
)
checkVisibility
(
@
view
,
false
,
false
,
true
)
describe
"cancel post resets form "
,
->
beforeEach
->
...
...
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