-
Notifications
You must be signed in to change notification settings - Fork 7
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
Wc 70 textinput pure component #246
Changes from all commits
dab2fe4
2ea5814
e957db2
8fc19bf
b0858c9
45b33b5
b2abb9a
b6582cc
bfd70c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import React from 'react'; | ||
import createReactClass from 'create-react-class'; | ||
import TestUtils from 'react-addons-test-utils'; | ||
|
||
export const variantTest = (FoundationComponent, className, variants) => { | ||
|
@@ -32,3 +33,13 @@ export const hasRoleAttribute = (el, roleName) => { | |
export const componentHasProperty = (component, prop, value) => { | ||
expect(component && component.props && component.props[prop] === value).toBe(true); | ||
}; | ||
|
||
// Note: functional components need to be | ||
// wrapped it in a stateful component to use TestUtils effectively | ||
export const TestWrapper = createReactClass({ | ||
render: function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in general the preferred solution would be to use enzyme instead of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok so - how do we start using enzyme? we can do this in a separate branch and I can make a ticket for that. if you want I can add the deprecated comment but I dont know if that really helps?... as of this tool set and library this code is valid. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure no problem. steve and I are on the team. I can do some reading - I just would like to do this upgrade/changes in a separate ticket to make sure it corrects this problem. I'm also checking in with adam to make sure he knows. |
||
return ( | ||
<div>{this.props.children}</div> | ||
); | ||
} | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3685,14 +3685,14 @@ js-tokens@^3.0.0: | |
version "3.0.1" | ||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" | ||
|
||
[email protected], js-yaml@^3.4.3, js-yaml@^3.5.1: | ||
[email protected], js-yaml@^3.5.1: | ||
version "3.6.1" | ||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.6.1.tgz#6e5fe67d8b205ce4d22fad05b7781e8dadcc4b30" | ||
dependencies: | ||
argparse "^1.0.7" | ||
esprima "^2.6.0" | ||
|
||
js-yaml@^3.7.0, js-yaml@~3.7.0: | ||
js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@~3.7.0: | ||
version "3.7.0" | ||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80" | ||
dependencies: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A renderComponent function might also be helpful for future updates... e.g. https://github.com/meetup/mup-web/blob/master/src/components/events/eventTimeDisplay.test.jsx#L19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since I won't be using that in these tests I'm reluctant to add it. I will when I do though!