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

@agorize/gommette

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agorize/gommette - npm Package Compare versions

Comparing version 1.15.1 to 1.16.0

2

package.json

@@ -71,3 +71,3 @@ {

},
"version": "1.15.1",
"version": "1.16.0",
"author": "",

@@ -74,0 +74,0 @@ "keywords": [],

@@ -6,2 +6,3 @@ import { shallowMount, createLocalVue } from '@vue/test-utils'

import debounce from 'lodash.debounce'
import renderCases from './GoCookieConsent.render-cases'

@@ -21,2 +22,4 @@ const localVue = createLocalVue()

let checkOffset
let clickOnLink
let onClose
let debounceCheckOffset

@@ -29,2 +32,3 @@ let closeCookieConsent

checkOffset = jest.fn()
clickOnLink = jest.fn()
debounceCheckOffset = jest.fn()

@@ -43,3 +47,4 @@

checkNewOffset,
checkOffset
checkOffset,
clickOnLink,
}

@@ -62,2 +67,8 @@ })

it('should add click event listener on document', async () => {
await document.querySelector('body').dispatchEvent(new Event('click'))
expect(clickOnLink).toBeCalled()
})
it('should set debounceCheckOffset function', () => {

@@ -151,2 +162,49 @@ expect(JSON.stringify(wrapper.vm.debounceCheckOffset)).toEqual(JSON.stringify(debounce(checkNewOffset, 500)))

describe('methods - clickOnLink', () => {
beforeEach(() => {
onClose = jest.fn()
wrapper = shallowMount(GoCookieConsent, {
propsData: {
bodyContent: 'text',
acceptLabel: 'label',
privacyData: {
label: 'privacy data'
}
},
localVue,
attachToDocument: true,
stubs: ['GoIcon'],
methods: {
checkNewOffset,
checkOffset,
onClose,
}
})
})
it('should not called onClose event', async () => {
const clickEvent = new Event('click')
await wrapper.vm.clickOnLink(clickEvent)
expect(onClose).not.toBeCalled()
})
describe('when target is link element', () => {
it('should called onClose event', async () => {
const link = document.createElement('a')
link.setAttribute('href', 'http://test.com')
let event = {
target: link
}
await wrapper.vm.clickOnLink(event)
expect(onClose).toBeCalled()
})
})
})
describe('methods - onClick', () => {

@@ -153,0 +211,0 @@ beforeEach(() => {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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