Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
ed20d5a1
Commit
ed20d5a1
authored
10 years ago
by
Jonathan Piacenti
Browse files
Options
Downloads
Patches
Plain Diff
Inverted boolean for rendering in CheckVisible.
parent
bd57d56b
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/static/coffee/spec/discussion/view/new_post_view_spec.coffee
+12
-12
12 additions, 12 deletions
...tic/coffee/spec/discussion/view/new_post_view_spec.coffee
with
12 additions
and
12 deletions
common/static/coffee/spec/discussion/view/new_post_view_spec.coffee
+
12
−
12
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
->
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment