Skip to content

Commit 18cd16b

Browse files
committed
Use a new describe for testing restart
1 parent 3e9602c commit 18cd16b

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

tests/index.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ describe('demo app', function () {
8181
})
8282

8383
describe('when clicking on a section from the nav bar', function () {
84-
it('shows the selected section in the main area', function () {
84+
it('it shows the selected section in the main area', function () {
8585
return app.client.isVisible('#windows-section').should.eventually.be.true
8686
.click('button[data-section="windows"]').pause(100)
8787
.waitForVisible('#windows-section')
@@ -95,8 +95,8 @@ describe('demo app', function () {
9595
})
9696
})
9797

98-
describe('when a task is clicked', function () {
99-
it('it expands', function () {
98+
describe('when a demo title is clicked', function () {
99+
it('it expands the demo content', function () {
100100
var onlyFirstVisible = Array(21).fill(false)
101101
onlyFirstVisible[0] = true
102102

@@ -105,9 +105,20 @@ describe('demo app', function () {
105105
.click('.js-container-target')
106106
.waitForVisible('.toggle-content')
107107
.isVisible('.toggle-content').should.eventually.deep.equal(onlyFirstVisible)
108+
})
109+
})
110+
111+
describe('when the app is restarted after use', function () {
112+
it('it launches at last visted section & demo', function () {
113+
var onlyFirstVisible = Array(21).fill(false)
114+
onlyFirstVisible[0] = true
115+
116+
return app.client.waitForVisible('#windows-section')
108117
.then(restartApp)
109118
.then(function () {
110119
return app.client.waitForVisible('#windows-section')
120+
.isVisible('#windows-section').should.eventually.be.true
121+
.isVisible('.toggle-content').should.eventually.deep.equal(onlyFirstVisible)
111122
})
112123
})
113124
})

0 commit comments

Comments
 (0)