Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
show back to app link on tablet (bug 1127330)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngokevin committed Jan 30, 2015
1 parent e52381a commit ca2ac87
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 14 deletions.
26 changes: 13 additions & 13 deletions src/media/css/typography.styl
Expand Up @@ -103,6 +103,16 @@ dd {

.back-to-app {
display: none;

&:before {
content: "\2039";
display: inline-block;
font-size: 28px;
font-weight: 300;
margin-right: 10px;
position: relative;
top: 3px;
}
}

.prose {
Expand Down Expand Up @@ -145,6 +155,9 @@ dd {
}

@media $base-tablet {
.back-to-app {
display: inline-block;
}
h1 {
font-size: 30px;
}
Expand All @@ -159,19 +172,6 @@ dd {
margin: 48px 0 0;
padding: 18px 15px;
}
.back-to-app {
display: inline-block;

&:before {
content: "\2039";
display: inline-block;
font-size: 28px;
font-weight: 300;
margin-right: 10px;
position: relative;
top: 3px;
}
}
.island.prose {
padding: 24px;
}
Expand Down
15 changes: 15 additions & 0 deletions tests/lib/helpers.js
Expand Up @@ -257,6 +257,11 @@ function setUpDesktop() {
}


function setUpTablet() {
changeViewportTablet();
}


function tearDown() {
changeViewportMobile();
}
Expand All @@ -271,6 +276,15 @@ function desktopTest(testObj) {
}


function tabletTest(testObj) {
// Wrapper around test object to set up tablet viewport.
return _.extend(testObj, {
setUp: setUpTablet,
tearDown: tearDown
});
}


module.exports = {
assertAPICallWasMade: assertAPICallWasMade,
assertContainsText: assertContainsText,
Expand All @@ -288,6 +302,7 @@ module.exports = {
makeUrl: makeUrl,
setUpDesktop: setUpDesktop,
startCasper: startCasper,
tabletTest: tabletTest,
tearDown: tearDown,
waitForPageLoaded: waitForPageLoaded,
};
20 changes: 19 additions & 1 deletion tests/ui/app/reviews.js
@@ -1,7 +1,7 @@
/*
Tests for app reviews.
*/
var helpers = require('../lib/helpers');
var helpers = require('../../lib/helpers');

function testAddReviewModal(test) {
casper.waitForSelector('.add-review-form', function() {
Expand Down Expand Up @@ -175,3 +175,21 @@ casper.test.begin('Test login to r? if already r? on desktop', helpers.desktopTe
helpers.done(test);
}
}));


casper.test.begin('Test reviews page back to app link', helpers.tabletTest({
test: function(test) {
helpers.startCasper({path: '/app/has_rated/ratings'});

helpers.waitForPageLoaded(function() {
test.assertVisible('.back-to-app');
casper.click('.back-to-app');
});

casper.waitForSelector('[data-page-type~="detail"]', function() {
test.assertExists('.detail');
});

helpers.done(test);
}
}));

0 comments on commit ca2ac87

Please sign in to comment.