Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

asva-vue-filters

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asva-vue-filters - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

1

mixins/child.js

@@ -38,3 +38,2 @@ import _ from 'lodash'

this.bus.$on('set-filters', function (filters) {
console.log(filters)
self.setFilters(filters)

@@ -41,0 +40,0 @@ })

2

package.json
{
"name": "asva-vue-filters",
"version": "1.0.0",
"version": "1.1.0",
"description": "Decoupled filter block for vue.js. Mixins and example components",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -10,6 +10,8 @@ import Vue from 'vue'

var filterChangedSpy = jasmine.createSpy('filter-changed')
var filterDisabledSpy = jasmine.createSpy('filter-disabled')
var changeCount = 0
var lastFilters = {}
var disableCount = 0
var disableKey = ''
beforeEach(function() {
beforeEach(function () {

@@ -20,16 +22,24 @@ var parentComponent = {

name="order"
:bus="bus"
v-ref:child
></vm-sorting-order-filter>
`,
ready() {
this.bus.$on('change', function (filters) {
changeCount += 1
lastFilters = filters
})
this.bus.$on('disable', function (key) {
disableCount += 1
disableKey = key
})
},
components: {
vmSortingOrderFilter
},
events: {
'filter-changed': function (filters){
filterChangedSpy(filters)
},
'filter-disabled': function (key){
filterDisabledSpy(key)
},
}
data(){
return {
bus: new Vue,
}
},
}

@@ -56,15 +66,15 @@

expect(getClass(child)).toBe('fa fa-sort-asc');
expect(filterChangedSpy.calls.count()).toBe(1)
expect(filterChangedSpy.calls.mostRecent().args[0]).toEqual({'order': 'asc'})
expect(changeCount).toBe(1)
expect(lastFilters).toEqual({'order': 'asc'})
$(child.$el).click()
Vue.nextTick(function () {
expect(getClass(child)).toBe('fa fa-sort-desc')
expect(filterChangedSpy.calls.count()).toBe(2)
expect(filterChangedSpy.calls.mostRecent().args[0]).toEqual({'order': 'desc'})
expect(changeCount).toBe(2)
expect(lastFilters).toEqual({'order': 'desc'})
$(child.$el).click()
Vue.nextTick(function () {
expect(getClass(child)).toBe('fa fa-sort');
expect(filterDisabledSpy.calls.count()).toBe(1)
expect(filterDisabledSpy.calls.mostRecent().args[0]).toBe('order')
done();
expect(getClass(child)).toBe('fa fa-sort')
expect(disableCount).toBe(1)
expect(disableKey).toBe('order')
done()
})

@@ -71,0 +81,0 @@ })

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc