Last active
June 12, 2019 05:18
-
-
Save eyaleizenberg/f798d5dfdcc10f42b9d027a68f174c07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { HelloPerson, Props } from './hello_person.component'; | |
import { shallow } from 'enzyme'; | |
export class HelloPersonDriver { | |
private wrapper; | |
private props: Props = { | |
name: 'some name' | |
} | |
given = { | |
name: (value: string): this => { | |
this.props.name = value; | |
return this; | |
} | |
}; | |
when = { | |
rendered: (): this => { | |
this.wrapper = shallow<HelloPerson>(<HelloPerson {...this.props} />); | |
return this; | |
} | |
}; | |
get = { | |
renderedName: (): string => this.wrapper.find('#name').text() | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment