Skip to content

Commit 2eea47d

Browse files
bartlomiejuyyx990803
authored andcommitted
added test spec for state export/import (vuejs#104)
1 parent 160daa0 commit 2eea47d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/specs/test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,22 @@ module.exports = {
100100
.assert.containsText('#counter p', '2')
101101
.frame(null)
102102

103+
// copy vuex state
104+
.click('.top .buttons .button:nth-child(1)')
105+
.assert.containsText('.top .buttons .button:nth-child(1) .message', '(Copied to clipboard!)')
106+
107+
// import vuex state
108+
.click('.top .buttons .button:nth-child(2)')
109+
.assert.elementPresent('.import-state')
110+
.setValue('.import-state textarea', '{invalid: json}')
111+
.assert.visible('.message.invalid-json')
112+
.clearValue('.import-state textarea')
113+
.setValue('.import-state textarea', '{"valid": "json"}')
114+
.waitForElementNotVisible('.message.invalid-json', 500)
115+
.assert.containsText('.vuex-state-inspector', 'valid: "json"')
116+
.click('.top .buttons .button:nth-child(2)')
117+
.waitForElementNotPresent('.import-state', 500)
118+
103119
// done
104120
.end()
105121
}

0 commit comments

Comments
 (0)