Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert the Persona component to module CSS. #1067

Closed
wants to merge 22 commits into from

Conversation

ipip2005
Copy link
Contributor

Pull request checklist

  • Addresses an existing issue? No!
  • Include a change request file if publishing
  • New feature, bugfix, or enhancement
    • Includes tests
  • Documentation update

Focus areas to test

  1. Update the test code and they are passing.
  2. Gulp serve the fabric-example and the Persona component looks good.

@micahgodbolt micahgodbolt added this to the css modules milestone Feb 23, 2017
@micahgodbolt micahgodbolt changed the base branch from master to module-css-updates February 23, 2017 18:43
@@ -16,46 +17,46 @@ describe('Persona', () => {

it('renders with expected initialsColor if none was provided', () => {
const wrapper = shallow(<Persona primaryText='Kat Larrson' />);
let result = wrapper.find('.ms-Persona-initials--red');
let result = wrapper.find('.' + styles.isRootInitialsRed);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not a state but a variant, so use rootInitialsRed, or rootInitialsAreRed. Also 'is initials' isn't proper grammar.

expect(result).to.have.length(1);

const wrapper2 = shallow(<Persona primaryText='Annie Lindqvist' />);
result = wrapper2.find('.ms-Persona-initials--darkRed');
result = wrapper2.find('.' + styles.isRootInitialsDarkRed);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rootInitialsDarkRed

expect(result).to.have.length(1);
});

it('uses provided initialsColor if one was specified', () => {
const wrapper = shallow(<Persona primaryText='Kat Larrson' initialsColor={ PersonaInitialsColor.lightBlue } />);
let result = wrapper.find('.ms-Persona-initials--lightBlue');
let result = wrapper.find('.' + styles.isRootInitialsLightBlue);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rootInitialsLightBlue

[PersonaInitialsColor.orange]: 'ms-Persona-initials--orange',
[PersonaInitialsColor.red]: 'ms-Persona-initials--red',
[PersonaInitialsColor.darkRed]: 'ms-Persona-initials--darkRed'
[PersonaInitialsColor.lightBlue]: 'ms-Persona-initials--lightBlue ' + styles.isRootInitialsLightBlue,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find 'isRoot' and replace with 'root' :)

@micahgodbolt micahgodbolt mentioned this pull request Feb 24, 2017
@micahgodbolt
Copy link
Member

fixes made in #1109

@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants