@codecademy/brand-components
Advanced tools
Comparing version 0.0.2-alpha.472f03.1468 to 0.0.2-alpha.54bacf.1458
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); | ||
}); | ||
}); |
{ | ||
"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
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
13543
0
208