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

feat(native): Add toBeDisabled #140

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Conversation

suany0805
Copy link

No description provided.

@suany0805 suany0805 force-pushed the feat/native-to-be-disabled branch from c61ba82 to 190ce45 Compare November 12, 2024 20:35
@suany0805 suany0805 force-pushed the feat/native-to-be-disabled branch from 4c514fe to 2259962 Compare November 26, 2024 20:48
@suany0805 suany0805 force-pushed the feat/native-to-be-disabled branch from 2259962 to 72efbf8 Compare November 26, 2024 20:59
@suany0805 suany0805 force-pushed the feat/native-to-be-disabled branch from 5817dc1 to 1e2a9c3 Compare November 28, 2024 21:07
@suany0805 suany0805 force-pushed the feat/native-to-be-disabled branch from 1e2a9c3 to 5fbe42a Compare November 28, 2024 21:23
@suany0805 suany0805 marked this pull request as ready for review December 2, 2024 14:36
@suany0805 suany0805 requested a review from JoseLion as a code owner December 2, 2024 14:36
lopenchi and others added 2 commits December 2, 2024 15:53
Co-Authored-By: Suany Chalan <79164262+suany0805@users.noreply.github.com>
@JoseLion JoseLion changed the title feat(Native) - Native toBeDisabled feat(native): Add toBeDisabled Dec 4, 2024
Copy link
Member

@JoseLion JoseLion left a comment

Choose a reason for hiding this comment

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

Looks good so far! There's a few things to address but I think we're on the right path in general. Let me know if you have any questions 🙂

package.json Outdated Show resolved Hide resolved
packages/native/src/lib/ElementAssertion.ts Outdated Show resolved Hide resolved
return "null";
}

return `<${this.actual.type.toString()} testID="${this.actual.props.testID}"... />`;
Copy link
Member

Choose a reason for hiding this comment

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

Are we sure about this? Not all elements will have a testID. Also, using the testID should be our last resource when using tools like testing-library.

packages/native/src/lib/ElementAssertion.ts Outdated Show resolved Hide resolved
packages/native/src/lib/ElementAssertion.ts Outdated Show resolved Hide resolved
packages/native/test/lib/ElementAssertion.test.tsx Outdated Show resolved Hide resolved
packages/native/test/lib/ElementAssertion.test.tsx Outdated Show resolved Hide resolved
packages/native/test/lib/ElementAssertion.test.tsx Outdated Show resolved Hide resolved
packages/native/test/lib/ElementAssertion.test.tsx Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

We're missing tests for .not.toBeDisabled() and not.ToBeEnabled(). The messaging is different, so having some unit tests is good. I'd test them together with the not inverted test cases to make things simpler, check the core package for examples 🙂

@suany0805 suany0805 force-pushed the feat/native-to-be-disabled branch from 0022d85 to 898721a Compare December 23, 2024 21:34
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.

3 participants