Commit 0035c10 1 parent 4f32c35 commit 0035c10 Copy full SHA for 0035c10
File tree 3 files changed +43
-5
lines changed
3 files changed +43
-5
lines changed Original file line number Diff line number Diff line change 1
1
<h1 >Media</h1 >
2
2
3
- <LinkTo @query ={{ hash filter =" albums" }} >Albums</LinkTo >
4
- <LinkTo @query ={{ hash filter =" movies" }} >Movies</LinkTo >
3
+ <LinkTo @query ={{ hash filter =" albums" }} class = " album-link " >Albums</LinkTo >
4
+ <LinkTo @query ={{ hash filter =" movies" }} class = " movies-link " >Movies</LinkTo >
5
5
6
6
<ul >
7
7
{{ #each this.media as |medium i |}}
8
8
<li >
9
- <LinkTo @route =" media.medium" @model ={{ i }} >
9
+ <LinkTo @route =" media.medium" @model ={{ i }} class = " media-link " >
10
10
{{ medium.title }}
11
11
</LinkTo >
12
12
</li >
Original file line number Diff line number Diff line change 1
- <h1 >Not Found</h1 >
1
+ <h1 class = " not-found-title " >Not Found</h1 >
2
2
3
- <p >The page you were looking for could not be found.</p >
3
+ <p class = " not-found-description " >The page you were looking for could not be found.</p >
Original file line number Diff line number Diff line change
1
+ import { module , test } from "qunit" ;
2
+ import {
3
+ click ,
4
+ visit ,
5
+ currentRouteName ,
6
+ currentURL ,
7
+ } from "@ember/test-helpers" ;
8
+ import { setupApplicationTest } from "ember-qunit" ;
9
+
10
+ module ( "Acceptance | basic funtionality" , function ( hooks ) {
11
+ setupApplicationTest ( hooks ) ;
12
+
13
+ test ( "listing and selecting a medium" , async function ( assert ) {
14
+ await visit ( "/media" ) ;
15
+ assert . equal ( document . querySelectorAll ( ".media-link" ) . length , 3 ) ;
16
+
17
+ await click ( document . querySelector ( ".movies-link" ) ) ;
18
+ assert . equal ( currentURL ( ) , "/media?filter=movies" ) ;
19
+ assert . equal ( document . querySelectorAll ( ".media-link" ) . length , 7 ) ;
20
+
21
+ await click ( document . querySelectorAll ( ".media-link" ) [ 6 ] ) ;
22
+ assert . equal ( currentURL ( ) , "/media/6?filter=movies" ) ;
23
+ } ) ;
24
+
25
+ test ( "shows the not-found route for non existent routes" , async function ( assert ) {
26
+ await visit ( "/i-do-not-exist" ) ;
27
+
28
+ assert . equal ( currentRouteName ( ) , "not-found" ) ;
29
+ assert . equal (
30
+ document . querySelector ( ".not-found-title" ) . textContent ,
31
+ "Not Found"
32
+ ) ;
33
+ assert . equal (
34
+ document . querySelector ( ".not-found-description" ) . textContent ,
35
+ "The page you were looking for could not be found."
36
+ ) ;
37
+ } ) ;
38
+ } ) ;
You can’t perform that action at this time.
0 commit comments