Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/devtools/components/VuexHistory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export default {
}
}
// simple case-insensitve search
this.invalidRegex = false
return new RegExp(this.escapeStringForRegExp(this.userInputFilter), 'i')
},
filteredHistory () {
Expand Down Expand Up @@ -119,7 +120,6 @@ export default {
},
clearFilter () {
this.userInputFilter = ''
this.invalidRegex = false
},
escapeStringForRegExp (str) {
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&')
Expand Down
15 changes: 15 additions & 0 deletions test/specs/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@ module.exports = {
.assert.containsText('.vuex-state-inspector', 'type: "DECREMENT"')
.assert.containsText('.vuex-state-inspector', 'count: 1')

// filtering
.setValue('.search-box', 'inc')
.assert.count('.history .entry', 3)
.click('.buttons a:last-of-type')
.assert.value('.search-box', '')
.setValue('.search-box', '/dec/i')
.assert.count('.history .entry', 2)
.clearValue('.search-box')
.setValue('.search-box', '/dec)/i')
.waitForElementVisible('.invalid-regex', 100)
.assert.count('.history .entry', 4)
.setValue('.search-box', '\b\b\b')
.waitForElementNotVisible('.invalid-regex', 100)
.click('.buttons a:last-of-type')

// time travel
.click('.history .entry:nth-child(3)')
.assert.cssClassPresent('.history .entry:nth-child(3)', 'active')
Expand Down