Skip to content

fix(component): fix unexpected match case #3

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

Merged
merged 1 commit into from
May 31, 2016
Merged

Conversation

azu
Copy link
Collaborator

@azu azu commented May 31, 2016

Check parent and child key before matching value

    class FixedBar extends React.Component {
        render() {
            return <div>{this.props.children}</div>
        }
    }
    const Order = {
        High: true,
        Middle: true,
        Low: false
    };
    const wrapper = shallow(<ToggleOrPattern High={Order.High} Middle={Order.Middle} Low={Order.Low}>
        <FixedBar High={true}>High</FixedBar>
        <FixedBar Middle={true}>Middle</FixedBar>
        <FixedBar Low={true}>Low</FixedBar>
        <FixedBar Middle={true}>Middle</FixedBar>
    </ToggleOrPattern>);
    // remove `Low`
    assert.equal(wrapper.html(), `<div class="TogglePattern ToggleOrPattern"><div>High</div><div>Middle</div><div>Middle</div></div>`)

check parent and child key before matching value
@azu azu merged commit f12a1bf into master May 31, 2016
@azu azu deleted the fix-unexpected-case branch May 31, 2016 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant