qlik-oss/picasso.js

View on GitHub
plugins/hammer/src/__tests__/hammer.spec.js

Summary

Maintainability
D
2 days
Test Coverage

Showing 6 of 6 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

it('should not add event listeners when state is off', () => {
hammerInteraction.set(settings);
expect(element.listeners.length).to.equal(3);
hammerInteraction.off();
expect(element.listeners.length).to.equal(0);
Severity: Major
Found in plugins/hammer/src/__tests__/hammer.spec.js and 1 other location - About 4 hrs to fix
packages/picasso.js/src/web/interactions/__tests__/native.spec.js on lines 53..60

Similar blocks of code found in 2 locations. Consider refactoring.
Open

it('should add event listeners again when on is called', () => {
hammerInteraction.set(settings);
expect(element.listeners.length).to.equal(3);
hammerInteraction.off();
expect(element.listeners.length).to.equal(0);
Severity: Major
Found in plugins/hammer/src/__tests__/hammer.spec.js and 1 other location - About 4 hrs to fix
packages/picasso.js/src/web/interactions/__tests__/native.spec.js on lines 45..52

Similar blocks of code found in 4 locations. Consider refactoring.
Open

it('should remove event listeners when off is called', () => {
hammerInteraction.set(settings);
expect(element.listeners.length).to.equal(3);
hammerInteraction.off();
expect(element.listeners.length).to.equal(0);
Severity: Major
Found in plugins/hammer/src/__tests__/hammer.spec.js and 3 other locations - About 2 hrs to fix
packages/picasso.js/src/web/interactions/__tests__/native.spec.js on lines 39..44
packages/picasso.js/src/web/interactions/__tests__/native.spec.js on lines 72..77
plugins/hammer/src/__tests__/hammer.spec.js on lines 94..99

Similar blocks of code found in 4 locations. Consider refactoring.
Open

it('remove all event listeners on destroy', () => {
hammerInteraction.set(settings);
expect(element.listeners.length).to.equal(3);
hammerInteraction.destroy();
expect(element.listeners.length).to.equal(0);
Severity: Major
Found in plugins/hammer/src/__tests__/hammer.spec.js and 3 other locations - About 2 hrs to fix
packages/picasso.js/src/web/interactions/__tests__/native.spec.js on lines 39..44
packages/picasso.js/src/web/interactions/__tests__/native.spec.js on lines 72..77
plugins/hammer/src/__tests__/hammer.spec.js on lines 52..57

Similar blocks of code found in 2 locations. Consider refactoring.
Open

it('should not add events to element if enabled is false', () => {
settings.enable = false;
hammerInteraction.set(settings);
expect(element.listeners.length).to.equal(0);
});
Severity: Major
Found in plugins/hammer/src/__tests__/hammer.spec.js and 1 other location - About 1 hr to fix
packages/picasso.js/src/web/interactions/__tests__/native.spec.js on lines 34..38

Similar blocks of code found in 2 locations. Consider refactoring.
Open

it('should add ', () => {
hammerInteraction.set(settings);
expect(element.listeners.length).to.equal(3);
});
Severity: Minor
Found in plugins/hammer/src/__tests__/hammer.spec.js and 1 other location - About 50 mins to fix
packages/picasso.js/src/web/interactions/__tests__/native.spec.js on lines 30..33

There are no issues that match your filters.

Category
Status