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

sling-web-component-brand-icon

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sling-web-component-brand-icon - npm Package Compare versions

Comparing version 1.8.0 to 1.11.0

6

package.json
{
"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%');
});
});
});
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