Skip to content

Commit

Permalink
test: add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
lokyoung committed Mar 22, 2017
1 parent 2f5fb30 commit 5302468
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# vuejs-paginate [![npm version](https://badge.fury.io/js/vuejs-paginate.svg)](https://badge.fury.io/js/vuejs-paginate) [![Build Status](https://travis-ci.org/lokyoung/vuejs-paginate.svg?branch=master)](https://travis-ci.org/lokyoung/vuejs-paginate)
# vuejs-paginate
[![npm version](https://badge.fury.io/js/vuejs-paginate.svg)](https://badge.fury.io/js/vuejs-paginate) [![Build Status](https://travis-ci.org/lokyoung/vuejs-paginate.svg?branch=master)](https://travis-ci.org/lokyoung/vuejs-paginate)

[![NPM](https://nodei.co/npm/vuejs-paginate.png)](https://nodei.co/npm/vuejs-paginate/)

Expand Down
2 changes: 1 addition & 1 deletion demo/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default {
<style lang="css">
.page-item {
}
.page-link-item{
.page-link-item {
}
.prev-item {
}
Expand Down
17 changes: 17 additions & 0 deletions test/components/paginate_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,23 @@ describe('Paginate', () => {
})
})
})

it('set forcePage in initialPage', () => {
const vm = new Component({
propsData: {
pageCount: 10,
initialPage: 5,
forcePage: 5
}
}).$mount()

expect(vm.$el.querySelector(".active a").textContent).to.equal("6")
const nextButton = vm.$el.querySelector("li:last-child a")
nextButton.click()
Vue.nextTick(() => {
expect(vm.$el.querySelector(".active a").textContent).to.equal("6")
})
})
})

describe('page range tests', () => {
Expand Down

0 comments on commit 5302468

Please sign in to comment.