Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit effc276

Browse files
step-6 phone images and links
- adding phone image and links to phone pages - add end2end test that verifies our phone links - css to style the page just a notch
1 parent c74c9f5 commit effc276

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

app/css/app.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,20 @@ body {
44
padding-top: 20px;
55
}
66

7+
.phones {
8+
list-style: none;
9+
}
10+
11+
.thumb {
12+
float: left;
13+
margin: -0.5em 1em 1.5em 0;
14+
padding-bottom: 1em;
15+
height: 100px;
16+
width: 100px;
17+
}
18+
19+
.phones li {
20+
clear: both;
21+
height: 115px;
22+
padding-top: 15px;
23+
}

app/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
<!--Body content-->
2828

2929
<ul class="phones">
30-
<li ng-repeat="phone in phones | filter:query | orderBy:orderProp">
31-
<span>{{phone.name}}</span>
30+
<li ng-repeat="phone in phones | filter:query | orderBy:orderProp" class="thumbnail">
31+
<a href="#/phones/{{phone.id}}" class="thumb"><img ng-src="{{phone.imageUrl}}" alt="{{phone.name}}"></a>
32+
<a href="#/phones/{{phone.id}}">{{phone.name}}</a>
3233
<p>{{phone.snippet}}</p>
3334
</li>
3435
</ul>

test/e2e/scenarios.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,15 @@ describe('PhoneCat App', function() {
5252
"Motorola XOOM\u2122 with Wi-Fi"
5353
]);
5454
});
55+
56+
57+
it('should render phone specific links', function() {
58+
var query = element(by.model('query'));
59+
query.sendKeys('nexus');
60+
element(by.css('.phones li a')).click();
61+
browser.getLocationAbsUrl().then(function(url) {
62+
expect(url).toEqual('/phones/nexus-s');
63+
});
64+
});
5565
});
5666
});

0 commit comments

Comments
 (0)