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

@codecademy/brand-components

Package Overview
Dependencies
Maintainers
1
Versions
462
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codecademy/brand-components - npm Package Compare versions

Comparing version 0.0.2-alpha.472f03.1468 to 0.0.2-alpha.54bacf.1458

32

dist/Avatar/__tests__/avatar-test.js
import { mount } from 'enzyme';
import React from 'react';
import { VisualTheme } from '../../../../gamut/src/theming/VisualTheme';
import { Avatar } from '..';
import styles from '../../styles.module.scss';
describe('Avatar', function () {

@@ -10,3 +12,3 @@ it('when an "alt" prop is passed, an "alt" attribute is added to the <img/>', function () {

}));
expect(wrapper.find('img[alt="alt"]').length).toEqual(1);
expect(wrapper.find('img[alt="alt"]')).toHaveLength(1);
});

@@ -20,4 +22,30 @@ it('when an "aria-labelledby" prop is passed, an "aria-labelledby" attribute is added to the <img/>', function () {

}, "I is label")));
expect(wrapper.find('img[aria-labelledby="label"]').length).toEqual(1);
expect(wrapper.find('img[aria-labelledby="label"]')).toHaveLength(1);
});
it('adds the light class to the container name as a default', function () {
var wrapper = mount(React.createElement(Avatar, {
src: "",
alt: ""
}));
var containerClassName = wrapper.find("div").prop('className');
expect(containerClassName).toContain(styles.lightContainer);
});
it('adds the light class to the container name when its theme is light', function () {
var wrapper = mount(React.createElement(Avatar, {
src: "",
theme: VisualTheme.LightMode,
alt: ""
}));
var containerClassName = wrapper.find("div").prop('className');
expect(containerClassName).toContain(styles.lightContainer);
});
it('adds the dark class to the container name when its theme is dark', function () {
var wrapper = mount(React.createElement(Avatar, {
src: "",
theme: VisualTheme.DarkMode,
alt: ""
}));
var containerClassName = wrapper.find("div").prop('className');
expect(containerClassName).toContain(styles.darkContainer);
});
});

7

package.json
{
"name": "@codecademy/brand-components",
"description": "Brand component library for Codecademy",
"version": "0.0.2-alpha.472f03.1468+472f0378",
"version": "0.0.2-alpha.54bacf.1458+54bacfc6",
"author": "Codecademy Engineering <dev@codecademy.com>",

@@ -34,6 +34,3 @@ "sideEffects": [

"license": "MIT",
"devDependencies": {
"copyfiles": "^2.1.1"
},
"gitHead": "472f03784679feed4018d8e64ba46a49c7ac0f0f"
"gitHead": "54bacfc6fc27b68513a8d656d1b372841cd65701"
}

Sorry, the diff of this file is not supported yet

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