Skip to content

Commit

Permalink
adds expandable-responsive-leaderboard to routes
Browse files Browse the repository at this point in the history
`/playlist-daily/`
`/schedule/`
`/stream/:slug`
  • Loading branch information
Brian Whitton committed Apr 24, 2017
1 parent 612f5eb commit bfa81ec
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/playlist-daily/date/template.hbs
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{{expandable-responsive-leaderboard
site='wqxr'
smallBreakpoint=media.isSmallOnly}}

{{django-page page=model class="l-constrained"}}
4 changes: 4 additions & 0 deletions app/playlist/template.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{{expandable-responsive-leaderboard
site='wqxr'
smallBreakpoint=media.isSmallOnly}}

<div class="l-constrained">
<main class="l-col2of3">
{{stream-playlist stream=model}}
Expand Down
4 changes: 4 additions & 0 deletions app/schedule/date/template.hbs
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{{expandable-responsive-leaderboard
site='wqxr'
smallBreakpoint=media.isSmallOnly}}

{{django-page page=model class="l-constrained"}}
54 changes: 54 additions & 0 deletions tests/acceptance/playlist-daily-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { test } from 'qunit';
import moduleForAcceptance from 'wqxr-web-client/tests/helpers/module-for-acceptance';

moduleForAcceptance('Acceptance | playlist daily', {
beforeEach() {
server.create('stream');
}
});

test('visiting /playlist-daily', function(assert) {
let date = moment().format('YYYY/MMM/DD').toLowerCase();
server.create('django-page', {id: `playlist-daily/${date}/?scheduleStation=wqxr`});
visit('/playlist-daily');

andThen(function() {
// ember strips the trailing slash
assert.equal(currentURL(), `/playlist-daily/${date}?scheduleStation=wqxr`);
assert.equal(find('#leaderboard').length, 1, 'leaderboard should be present');
});
});

test('clicking on /playlist-daily', function(assert) {
let date = moment().format('YYYY/MMM/DD').toLowerCase();
server.create('django-page', {id: 'fake/'});
server.create('django-page', {id: `playlist-daily/${date}/?scheduleStation=wqxr`});

visit('/fake');

andThen(function() {
click('a[href="/playlist-daily"]');
});

andThen(function() {
assert.equal(currentURL(), `/playlist-daily/${date}?scheduleStation=wqxr`);
});
});

test('transitioning to a specific schedule', function(assert) {
let date = moment().format('YYYY/MMM/DD').toLowerCase();
server.create('django-page', {
id: 'fake/',
testMarkup: `
<a href="/playlist-daily/?scheduleStation=wqxr" id="foo">foo</a>
`
});
server.create('django-page', {id: `playlist-daily/${date}/?scheduleStation=wqxr`});

visit('/fake');
click('#foo');

andThen(function() {
assert.equal(currentURL(), `/playlist-daily/${date}?scheduleStation=wqxr`);
});
});
2 changes: 2 additions & 0 deletions tests/acceptance/playlist-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ test('visiting /streams/wqxr', function(assert) {
andThen(function() {
assert.equal(currentURL(), '/streams/wqxr');
assert.equal(find('a[href="http://fooshow.com"]').text().trim(), 'Episode Foo');
assert.equal(find('#leaderboard').length, 1, 'leaderboard is present');
assert.equal(find('#rightRail').length, 1, 'sidebar ad is present');
});
});

Expand Down
1 change: 1 addition & 0 deletions tests/acceptance/schedule-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ test('visiting /schedule', function(assert) {
andThen(function() {
// ember strips the trailing slash
assert.equal(currentURL(), `/schedule/${date}?scheduleStation=wqxr`);
assert.equal(find('#leaderboard').length, 1, 'leaderboard is present');
});
});

Expand Down

0 comments on commit bfa81ec

Please sign in to comment.