-
Notifications
You must be signed in to change notification settings - Fork 714
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
new driver for hint testing #2898
base: master
Are you sure you want to change the base?
Conversation
const hintTouchableDriver = usePressableDriver<TouchableOpacityProps>(useComponentDriver({ | ||
renderTree: props.renderTree, | ||
testID: `${props.testID}` | ||
})); |
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.
Isn't this just the Hint
itself?
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.
yes it is, do you think that the naming isn't good ?
It's the Touchable
part of the component with out the View
wrapper
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.
Yes, I think it should be exported as press
and probably something like pressOnBackground: overlayDriver.press
for the overlay (same as in Modal
)
@adids1221 I'd also remove the comment from the change log 🙏 |
Also, nice work on the mock, I'm sure that was not easy 👍 |
@M-i-k-e-l fix most of the comments, about the |
@M-i-k-e-l didn't finished yet, having some issues with the |
@M-i-k-e-l as we spoke we can't use |
Hi @adids1221, |
return overlayDriver; | ||
}; | ||
|
||
const getIsModalVisible = () => { |
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.
IMO there should be an isVisible
for both modal
and overlay
Can't really remember the reason for your previous comment about modal's visibility, lets discuss it if it's still relevant.
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.
Ping on this
describe('Test Hint content', () => { | ||
it('Hint should include message', async () => { | ||
const renderTree = render(<HintTestComponent showHint/>); | ||
const message = renderTree.getByTestId(`${TEST_ID}.message.text`).props.children; |
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.
This should be exported from the driver
const renderTree = render(<HintTestComponent showHint onBackgroundPress={() => {}}/>); | ||
const driver = HintDriver({renderTree, testID: TEST_ID}); | ||
expect(await driver.exists()).toBeTruthy(); | ||
expect(await driver.isModalVisible()).toBeTruthy(); |
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.
Do we really want this or maybe just a generic isOpen
? WDYT?
isBackgroundExists, | ||
pressOnBackground, | ||
isModalVisible, | ||
...driver, |
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.
I don't like the ...driver
export, maybe export what is actually needed?
return modalDriver.isVisible(); | ||
}; | ||
|
||
const press = () => { |
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.
press
is show
? Or can it be both show
and hide
?
const expectedColor = Colors.$backgroundPrimaryHeavy; | ||
const renderTree = render(<HintTestComponent showHint/>); | ||
const driver = HintDriver({renderTree, testID: TEST_ID}); | ||
expect(await driver.getElement()).toBeTruthy(); |
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.
I'de change this to something else, what are we really testing here?
return { | ||
getBackgroundColor, | ||
getIcon, | ||
isBackgroundExists, |
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.
I prefer isBackgroundVisible
, WDYT?
return overlayDriver; | ||
}; | ||
|
||
const getIsModalVisible = () => { |
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.
Ping on this
Description
Hint - create new driver and refactor tests to it
Changelog
Additional info