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
e0e895a5
Commit
e0e895a5
authored
Aug 06, 2015
by
Peter Fogg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Bok Choy tests for teams page URL routing.
parent
117bc4a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
3 deletions
+37
-3
common/test/acceptance/tests/lms/test_teams.py
+35
-1
lms/djangoapps/teams/static/teams/js/views/teams_tab.js
+2
-2
No files found.
common/test/acceptance/tests/lms/test_teams.py
View file @
e0e895a5
...
@@ -30,7 +30,7 @@ class TeamsTabBase(UniqueCourseTest):
...
@@ -30,7 +30,7 @@ class TeamsTabBase(UniqueCourseTest):
def
create_topics
(
self
,
num_topics
):
def
create_topics
(
self
,
num_topics
):
"""Create `num_topics` test topics."""
"""Create `num_topics` test topics."""
return
[{
u"description"
:
str
(
i
),
u"name"
:
str
(
i
),
u"id"
:
i
}
for
i
in
xrange
(
num_topics
)]
return
[{
u"description"
:
i
,
u"name"
:
i
,
u"id"
:
i
}
for
i
in
map
(
str
,
xrange
(
num_topics
)
)]
def
create_teams
(
self
,
topic
,
num_teams
):
def
create_teams
(
self
,
topic
,
num_teams
):
"""Create `num_teams` teams belonging to `topic`."""
"""Create `num_teams` teams belonging to `topic`."""
...
@@ -89,6 +89,7 @@ class TeamsTabBase(UniqueCourseTest):
...
@@ -89,6 +89,7 @@ class TeamsTabBase(UniqueCourseTest):
self
.
assertNotIn
(
"Teams"
,
self
.
tab_nav
.
tab_names
)
self
.
assertNotIn
(
"Teams"
,
self
.
tab_nav
.
tab_names
)
@ddt.ddt
@attr
(
'shard_5'
)
@attr
(
'shard_5'
)
class
TeamsTabTest
(
TeamsTabBase
):
class
TeamsTabTest
(
TeamsTabBase
):
"""
"""
...
@@ -156,6 +157,39 @@ class TeamsTabTest(TeamsTabBase):
...
@@ -156,6 +157,39 @@ class TeamsTabTest(TeamsTabBase):
)
)
self
.
verify_teams_present
(
True
)
self
.
verify_teams_present
(
True
)
@ddt.data
(
(
'browse'
,
'div.topics-list'
),
(
'teams'
,
'p.temp-tab-view'
),
(
'teams/{topic_id}/{team_id}'
,
'div.discussion-module'
),
(
'topics/{topic_id}/create-team'
,
'div.create-team-instructions'
),
(
'topics/{topic_id}'
,
'div.teams-list'
),
(
'not-a-real-route'
,
'div.warning'
)
)
@ddt.unpack
def
test_url_routing
(
self
,
route
,
selector
):
"""Ensure that navigating to a URL route correctly updates the page
content.
"""
topics
=
self
.
create_topics
(
1
)
topic
=
topics
[
0
]
self
.
set_team_configuration
({
u'max_team_size'
:
10
,
u'topics'
:
topics
})
team
=
self
.
create_teams
(
topic
,
1
)[
0
]
self
.
teams_page
.
visit
()
self
.
browser
.
get
(
'{url}#{route}'
.
format
(
url
=
self
.
browser
.
current_url
,
route
=
route
.
format
(
topic_id
=
topic
[
'id'
],
team_id
=
team
[
'id'
]
))
)
self
.
teams_page
.
wait_for_ajax
()
self
.
assertTrue
(
self
.
teams_page
.
q
(
css
=
selector
)
.
present
)
self
.
assertTrue
(
self
.
teams_page
.
q
(
css
=
selector
)
.
visible
)
@attr
(
'shard_5'
)
@attr
(
'shard_5'
)
class
BrowseTopicsTest
(
TeamsTabBase
):
class
BrowseTopicsTest
(
TeamsTabBase
):
...
...
lms/djangoapps/teams/static/teams/js/views/teams_tab.js
View file @
e0e895a5
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
this
.
text
=
options
.
text
;
this
.
text
=
options
.
text
;
},
},
render
:
function
()
{
render
:
function
()
{
this
.
$el
.
text
(
this
.
text
);
this
.
$el
.
html
(
this
.
text
);
}
}
});
});
this
.
topicsCollection
=
new
TopicCollection
(
this
.
topicsCollection
=
new
TopicCollection
(
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
tabs
:
[{
tabs
:
[{
title
:
gettext
(
'My Teams'
),
title
:
gettext
(
'My Teams'
),
url
:
'teams'
,
url
:
'teams'
,
view
:
new
TempTabView
({
text
:
'
This is the new Teams tab.
'
})
view
:
new
TempTabView
({
text
:
'
<p class="temp-tab-view">This is the new Teams tab.</p>
'
})
},
{
},
{
title
:
gettext
(
'Browse'
),
title
:
gettext
(
'Browse'
),
url
:
'browse'
,
url
:
'browse'
,
...
...
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