sling-web-component-brand-icon
Advanced tools
Comparing version 1.8.0 to 1.11.0
{ | ||
"name": "sling-web-component-brand-icon", | ||
"version": "1.8.0", | ||
"version": "1.11.0", | ||
"description": "Sling Brand Icon", | ||
@@ -10,5 +10,5 @@ "module": "src/index.js", | ||
"dependencies": { | ||
"sling-framework": "^1.8.0", | ||
"sling-helpers": "^1.8.0" | ||
"sling-framework": "^1.11.0", | ||
"sling-helpers": "^1.11.0" | ||
} | ||
} |
@@ -6,3 +6,3 @@ # sling-web-component-brand-icon | ||
``` | ||
npm instal sling-web-component-brand-icon | ||
npm install sling-web-component-brand-icon | ||
``` | ||
@@ -9,0 +9,0 @@ |
@@ -1,2 +0,1 @@ | ||
/* eslint-disable */ | ||
import { registerComponent } from 'sling-helpers'; | ||
@@ -7,3 +6,3 @@ import { BrandIcon } from './BrandIcon.js'; | ||
let $brandIcon | ||
let $brandIcon; | ||
@@ -21,3 +20,4 @@ describe('Brand Icon', () => { | ||
it('Should reflect "brandid", "width" and "heigth" attribute to property ', () => { | ||
it('Should reflect "brandid", "width" and "height" ' | ||
+ 'attribute to property ', () => { | ||
$brandIcon.setAttribute('brandid', '2'); | ||
@@ -27,8 +27,9 @@ $brandIcon.setAttribute('width', 50); | ||
expect($brandIcon.brandid).to.equal(2) | ||
expect($brandIcon.width).to.equal('50') | ||
expect($brandIcon.height).to.equal('50') | ||
}) | ||
expect($brandIcon.brandid).to.equal(2); | ||
expect($brandIcon.width).to.equal('50'); | ||
expect($brandIcon.height).to.equal('50'); | ||
}); | ||
it('Should reflect "brandid", "width" and "heigth" property to attribute ', () => { | ||
it('Should reflect "brandid", "width" and "height" ' | ||
+ ' property to attribute ', () => { | ||
$brandIcon.brandid = 3; | ||
@@ -38,7 +39,62 @@ $brandIcon.width = 50; | ||
expect($brandIcon.getAttribute('brandid')).to.equal('3') | ||
expect($brandIcon.getAttribute('width')).to.equal('50') | ||
expect($brandIcon.getAttribute('height')).to.equal('50') | ||
}) | ||
expect($brandIcon.getAttribute('brandid')).to.equal('3'); | ||
expect($brandIcon.getAttribute('width')).to.equal('50'); | ||
expect($brandIcon.getAttribute('height')).to.equal('50'); | ||
}); | ||
it('Should not set "brandid", "width" and "height" property and remove ' + | ||
'the respective attribute', () => { | ||
$brandIcon.brandid = false; | ||
$brandIcon.width = false; | ||
$brandIcon.height = false; | ||
expect($brandIcon.getAttribute('brandid')).to.equal(null); | ||
expect($brandIcon.getAttribute('width')).to.equal(null); | ||
expect($brandIcon.getAttribute('height')).to.equal(null); | ||
}); | ||
it('Should get the correct svg based on the id', () => { | ||
// Visa | ||
$brandIcon.brandid = 1; | ||
expect($brandIcon.getSvg().includes('visa')).to.equal(true); | ||
// Mastercard | ||
$brandIcon.brandid = 2; | ||
expect($brandIcon.getSvg().includes('mastercard')).to.equal(true); | ||
// American Express | ||
$brandIcon.brandid = 3; | ||
expect($brandIcon.getSvg().includes('amex')).to.equal(true); | ||
// Ticket | ||
$brandIcon.brandid = 5; | ||
expect($brandIcon.getSvg().includes('ticket')).to.equal(true); | ||
// Sodexo | ||
$brandIcon.brandid = 6; | ||
expect($brandIcon.getSvg().includes('sodexo')).to.equal(true); | ||
// VR | ||
$brandIcon.brandid = 7; | ||
expect($brandIcon.getSvg().includes('vr')).to.equal(true); | ||
// Alelo | ||
$brandIcon.brandid = 8; | ||
expect($brandIcon.getSvg().includes('alelo')).to.equal(true); | ||
// Hipercard | ||
$brandIcon.brandid = 9; | ||
expect($brandIcon.getSvg().includes('hiper')).to.equal(true); | ||
// Senff | ||
$brandIcon.brandid = 12; | ||
expect($brandIcon.getSvg().includes('Page-1')).to.equal(true); | ||
// Elo | ||
$brandIcon.brandid = 171; | ||
expect($brandIcon.getSvg().includes('elo')).to.equal(true); | ||
}); | ||
describe('parseUnit', () => { | ||
it('Should return the value with `px` when theres no `px` or `%`', () => { | ||
expect(BrandIcon.parseUnit('50')).to.equal('50px'); | ||
}); | ||
it('Should return the value when the value contains ' + | ||
'`%` or `px` sign', () => { | ||
expect(BrandIcon.parseUnit('50px')).to.equal('50px'); | ||
expect(BrandIcon.parseUnit('50%')).to.equal('50%'); | ||
}); | ||
}); | ||
}); | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
113979
6
736
1
Updatedsling-framework@^1.11.0
Updatedsling-helpers@^1.11.0