profile
viewpoint
Michaël De Boey MichaelDeBoey Alpha IT Sint-Niklaas, Belgium https://michaeldeboey.be 👨‍💻 JavaScript/TypeScript engineer with a passion for @reactjs

codesandbox/codesandbox-client 9665

An online IDE for rapid web development

MichaelDeBoey/bnp-complaint-generator 1

Let's urge BNP Paribas Fortis to develop a working PSD 2 interface (API), so we all can have some Cake! 💪

MichaelDeBoey/ajv 0

The fastest JSON Schema Validator. Supports draft-04/06/07

MichaelDeBoey/apollo-client 0

:rocket: A fully-featured, production ready caching GraphQL client for every UI framework and GraphQL server

MichaelDeBoey/apollo-upload-client 0

A terminating Apollo Link for Apollo Client that allows FileList, File, Blob or ReactNativeFile instances within query or mutation variables and sends GraphQL multipart requests.

MichaelDeBoey/babel-plugin-codegen 0

💥 Generate code at build-time

MichaelDeBoey/babel-plugin-macros 0

🎣 Allows you to build simple compile-time libraries

MichaelDeBoey/babel-plugin-tester 0

Utilities for testing babel plugins

MichaelDeBoey/bnp-complaint-explanation-template 0

Let's urge BNP Paribas Fortis to develop a working PSD 2 interface (API), so we all can have some Cake! 💪

push eventMichaelDeBoey/eslint-plugin-node

Michaël De Boey

commit sha 2c341ff24661c2a34f890e5f827af02066b70b3b

chore: Update dependencies

view details

push time in 13 hours

push eventMichaelDeBoey/eslint-utils

Michaël De Boey

commit sha 022791006ef827af853bae35633f6156356ca3cd

feat: Support ESLint 7.x

view details

push time in 13 hours

pull request commentmysticatea/eslint-utils

feat: Support ESLint 7.x

Ping @mysticatea

This one can be merged 🙂

MichaelDeBoey

comment created time in 13 hours

PR opened facebook/create-react-app

Reviewers
feat: Update ESLint dependencies

Follow-up of #9251

+5 -5

0 comment

3 changed files

pr created time in 13 hours

create barnchMichaelDeBoey/create-react-app

branch : update-eslint-dependencies

created branch time in 13 hours

push eventMichaelDeBoey/create-react-app

Ian Schmitz

commit sha 759696dd62b3f6cda23c3c0197982135a94e48ee

Upgrade dependencies (#9317)

view details

Jeffrey Posnick

commit sha 8e720aefc62586346396f9e3c257288e1562888b

Switch to the Workbox InjectManifest plugin (#9205) Co-authored-by: Ian Schmitz <ianschmitz@gmail.com>

view details

Ian Schmitz

commit sha d1f32c44a241c7efb0f16ba97867f1d423b4bad5

Upgrade refresh plugin (#9348)

view details

Michaël De Boey

commit sha 2bef8a560970d85c88ecee3e06f0b6960918e1ee

feat: Update ESLint dependencies (#9251) Co-authored-by: Ian Schmitz <ianschmitz@gmail.com>

view details

Ian Sutherland

commit sha bdae9b6874904cf34b982c540847e3d6c32cdf42

Remove server worker registration from default templates (#9349)

view details

Dylan Brookes

commit sha a01b1c58bc2c23d71e523eee0642b741852b7069

Clarify wording in adding TypeScript to existing project (#9231)

view details

Michael Mok

commit sha 66bf7dfc43350249e2f09d138a20840dae8a0a4a

feat: better refresh plugin integration (#9375)

view details

Brody McKee

commit sha a79d8b8df65c20b020fb35c04e6191f9b4c27dc4

feat: exit on outdated create-react-app version (#9359)

view details

Ian Sutherland

commit sha 7ab0116939064c0417950fa7f92dff7324fe2126

Prepare 4.0.0 alpha release

view details

Rafael Quijada

commit sha 58db16b2eb45280dae24d3661ba2080ed642b355

Updated README.md Templates to Follow ESLint Markdown Rules (#9241)

view details

Sakito Mukai

commit sha de27bcfcc079c6644a14db08ef01df1f102e7a95

[Doc] fix React Testing Library example (#9245)

view details

Andy C

commit sha 1a6ef921fd146dbbb94e4b8dfb84968f80e43e61

Update running-tests.md (#9380)

view details

Ian Sutherland

commit sha aeaf575d2793de665cdab944ce450c7b1cce56a9

Add Fast Refresh warning when using React < 16.10 (#9350)

view details

Kline Moralee

commit sha 5bd6e73047ef0ccd2f31616255c79a939d6402c4

Publish refreshOverlayInterop with react-dev-utils (#9390)

view details

Gerrit Alex

commit sha 2c2e224984edddd8e655ebb8a113dce583f89c2a

fix: remove deprecated rule (#9401)

view details

Sam Chen

commit sha ebab256d38f9919ed19c9ec9df2141a4e31c7c04

clean formatMessage usage (#9059)

view details

Michaël De Boey

commit sha 3cf2b06c71c989d25a563705d89b77e8ed07ed2c

feat: Update testing-library dependencies to latest (#9252)

view details

Huáng Jùnliàng

commit sha f86cf4441b631c0386b5b8b7e395735497cd97fd

fix: use default modules option from `preset-env` (#9374)

view details

Stafford Williams

commit sha 42dcf79b43171449a116ddcb51dce7b043cdb1d2

Bump immer version (#8933) Co-authored-by: Ian Schmitz <ianschmitz@gmail.com> Co-authored-by: Ian Sutherland <ian@iansutherland.ca>

view details

Lenard Pratt

commit sha 6cd382621f5e3b9779e0576f2244196a8e976207

Upgrade whatwg-fetch (#9392) Co-authored-by: Ian Schmitz <ianschmitz@gmail.com>

view details

push time in 13 hours

push eventMichaelDeBoey/create-react-app

Ian Schmitz

commit sha 759696dd62b3f6cda23c3c0197982135a94e48ee

Upgrade dependencies (#9317)

view details

Jeffrey Posnick

commit sha 8e720aefc62586346396f9e3c257288e1562888b

Switch to the Workbox InjectManifest plugin (#9205) Co-authored-by: Ian Schmitz <ianschmitz@gmail.com>

view details

Ian Schmitz

commit sha d1f32c44a241c7efb0f16ba97867f1d423b4bad5

Upgrade refresh plugin (#9348)

view details

Michaël De Boey

commit sha 2bef8a560970d85c88ecee3e06f0b6960918e1ee

feat: Update ESLint dependencies (#9251) Co-authored-by: Ian Schmitz <ianschmitz@gmail.com>

view details

Ian Sutherland

commit sha bdae9b6874904cf34b982c540847e3d6c32cdf42

Remove server worker registration from default templates (#9349)

view details

Dylan Brookes

commit sha a01b1c58bc2c23d71e523eee0642b741852b7069

Clarify wording in adding TypeScript to existing project (#9231)

view details

Michael Mok

commit sha 66bf7dfc43350249e2f09d138a20840dae8a0a4a

feat: better refresh plugin integration (#9375)

view details

Brody McKee

commit sha a79d8b8df65c20b020fb35c04e6191f9b4c27dc4

feat: exit on outdated create-react-app version (#9359)

view details

Ian Sutherland

commit sha 7ab0116939064c0417950fa7f92dff7324fe2126

Prepare 4.0.0 alpha release

view details

Rafael Quijada

commit sha 58db16b2eb45280dae24d3661ba2080ed642b355

Updated README.md Templates to Follow ESLint Markdown Rules (#9241)

view details

Sakito Mukai

commit sha de27bcfcc079c6644a14db08ef01df1f102e7a95

[Doc] fix React Testing Library example (#9245)

view details

Andy C

commit sha 1a6ef921fd146dbbb94e4b8dfb84968f80e43e61

Update running-tests.md (#9380)

view details

Ian Sutherland

commit sha aeaf575d2793de665cdab944ce450c7b1cce56a9

Add Fast Refresh warning when using React < 16.10 (#9350)

view details

Kline Moralee

commit sha 5bd6e73047ef0ccd2f31616255c79a939d6402c4

Publish refreshOverlayInterop with react-dev-utils (#9390)

view details

Gerrit Alex

commit sha 2c2e224984edddd8e655ebb8a113dce583f89c2a

fix: remove deprecated rule (#9401)

view details

Sam Chen

commit sha ebab256d38f9919ed19c9ec9df2141a4e31c7c04

clean formatMessage usage (#9059)

view details

Michaël De Boey

commit sha 3cf2b06c71c989d25a563705d89b77e8ed07ed2c

feat: Update testing-library dependencies to latest (#9252)

view details

Huáng Jùnliàng

commit sha f86cf4441b631c0386b5b8b7e395735497cd97fd

fix: use default modules option from `preset-env` (#9374)

view details

Stafford Williams

commit sha 42dcf79b43171449a116ddcb51dce7b043cdb1d2

Bump immer version (#8933) Co-authored-by: Ian Schmitz <ianschmitz@gmail.com> Co-authored-by: Ian Sutherland <ian@iansutherland.ca>

view details

Lenard Pratt

commit sha 6cd382621f5e3b9779e0576f2244196a8e976207

Upgrade whatwg-fetch (#9392) Co-authored-by: Ian Schmitz <ianschmitz@gmail.com>

view details

push time in 13 hours

push eventMichaelDeBoey/create-react-app

Ian Schmitz

commit sha 759696dd62b3f6cda23c3c0197982135a94e48ee

Upgrade dependencies (#9317)

view details

Jeffrey Posnick

commit sha 8e720aefc62586346396f9e3c257288e1562888b

Switch to the Workbox InjectManifest plugin (#9205) Co-authored-by: Ian Schmitz <ianschmitz@gmail.com>

view details

Ian Schmitz

commit sha d1f32c44a241c7efb0f16ba97867f1d423b4bad5

Upgrade refresh plugin (#9348)

view details

Michaël De Boey

commit sha 2bef8a560970d85c88ecee3e06f0b6960918e1ee

feat: Update ESLint dependencies (#9251) Co-authored-by: Ian Schmitz <ianschmitz@gmail.com>

view details

Ian Sutherland

commit sha bdae9b6874904cf34b982c540847e3d6c32cdf42

Remove server worker registration from default templates (#9349)

view details

Dylan Brookes

commit sha a01b1c58bc2c23d71e523eee0642b741852b7069

Clarify wording in adding TypeScript to existing project (#9231)

view details

Michael Mok

commit sha 66bf7dfc43350249e2f09d138a20840dae8a0a4a

feat: better refresh plugin integration (#9375)

view details

Brody McKee

commit sha a79d8b8df65c20b020fb35c04e6191f9b4c27dc4

feat: exit on outdated create-react-app version (#9359)

view details

Ian Sutherland

commit sha 7ab0116939064c0417950fa7f92dff7324fe2126

Prepare 4.0.0 alpha release

view details

Rafael Quijada

commit sha 58db16b2eb45280dae24d3661ba2080ed642b355

Updated README.md Templates to Follow ESLint Markdown Rules (#9241)

view details

Sakito Mukai

commit sha de27bcfcc079c6644a14db08ef01df1f102e7a95

[Doc] fix React Testing Library example (#9245)

view details

Andy C

commit sha 1a6ef921fd146dbbb94e4b8dfb84968f80e43e61

Update running-tests.md (#9380)

view details

Ian Sutherland

commit sha aeaf575d2793de665cdab944ce450c7b1cce56a9

Add Fast Refresh warning when using React < 16.10 (#9350)

view details

Kline Moralee

commit sha 5bd6e73047ef0ccd2f31616255c79a939d6402c4

Publish refreshOverlayInterop with react-dev-utils (#9390)

view details

Gerrit Alex

commit sha 2c2e224984edddd8e655ebb8a113dce583f89c2a

fix: remove deprecated rule (#9401)

view details

Sam Chen

commit sha ebab256d38f9919ed19c9ec9df2141a4e31c7c04

clean formatMessage usage (#9059)

view details

Michaël De Boey

commit sha 3cf2b06c71c989d25a563705d89b77e8ed07ed2c

feat: Update testing-library dependencies to latest (#9252)

view details

Huáng Jùnliàng

commit sha f86cf4441b631c0386b5b8b7e395735497cd97fd

fix: use default modules option from `preset-env` (#9374)

view details

Stafford Williams

commit sha 42dcf79b43171449a116ddcb51dce7b043cdb1d2

Bump immer version (#8933) Co-authored-by: Ian Schmitz <ianschmitz@gmail.com> Co-authored-by: Ian Sutherland <ian@iansutherland.ca>

view details

Lenard Pratt

commit sha 6cd382621f5e3b9779e0576f2244196a8e976207

Upgrade whatwg-fetch (#9392) Co-authored-by: Ian Schmitz <ianschmitz@gmail.com>

view details

push time in 13 hours

delete branch MichaelDeBoey/create-react-app

delete branch : update-testing-library-dependencies

delete time in 13 hours

delete branch MichaelDeBoey/react-dates

delete branch : patch-2

delete time in 2 days

Pull request review commentprettier/prettier

XML/SVG support

 const options = {         since: "1.17.0",         description: "Lightning Web Components",       },+      { value: "xml", since: "0.0.0", description: "XML" },
      { value: "xml", since: "2.1.0", description: "XML" },
kddeisz

comment created time in 2 days

push eventMichaelDeBoey/react-dates

Michaël De Boey

commit sha 7878d3bf014f37aed1722621684687c335479fdc

Update package.json

view details

push time in 2 days

push eventMichaelDeBoey/react-dates

Jordan Harband

commit sha 0b1c7eee0aa151592695378251427134668f1e0c

[eslint] fix linting errors

view details

Jordan Harband

commit sha 4d859319440e600a3872c5cc80e4a0302aa02ca3

[Tests] tiny coverage bump

view details

Michaël De Boey

commit sha 5b29610dba5a00c0e61ac6c84ea58f0991690d4f

[Tests] add node 14

view details

Michaël De Boey

commit sha ea6136ee4616e504270f5102b6e202554626eb0d

Merge branch 'master' into patch-2

view details

push time in 2 days

pull request commentDefinitelyTyped/DefinitelyTyped

Increase PERF 10x

@mxstbr types are now:

C extends string | React.ComponentType<any>

So I think that's still possible because you can pass a React.ComponentType, no? 🤔

christianalfoni

comment created time in 4 days

PR opened DivvyDiary/divvydiary-crons

Update logger.js
+1 -1

0 comment

1 changed file

pr created time in 4 days

push eventMichaelDeBoey/divvydiary-crons

Michaël De Boey

commit sha df3712474a19f8cd2df4c840002618cd5401b7e1

Update logger.js

view details

push time in 4 days

startedcodeofsumit/tresor-import

started time in 4 days

delete branch MichaelDeBoey/testing-library-docs

delete branch : patch-1

delete time in 6 days

delete branch MichaelDeBoey/draft-js

delete branch : patch-1

delete time in 6 days

PR opened testing-library/testing-library-docs

Update setup.md

There's no example above

+14 -14

0 comment

1 changed file

pr created time in 7 days

push eventMichaelDeBoey/testing-library-docs

Michaël De Boey

commit sha 258d2137a4a70e6591846cab9b5ba6bb05c29830

Update setup.md

view details

push time in 7 days

issue commenttannerlinsley/react-query

bug(types): `defaultConfig` for `makeQueryCache` is typed incorrectly

@kamranayub What I meant was if this is still valid when you install react-query@tsnext?

kamranayub

comment created time in 7 days

delete branch TrySound/rollup-plugin-size-snapshot

delete branch : dependabot/npm_and_yarn/elliptic-6.5.3

delete time in 7 days

push eventTrySound/rollup-plugin-size-snapshot

dependabot[bot]

commit sha a27a9b2f9969a164445c628467775aecae6b5ee0

chore(deps): Bump elliptic from 6.5.2 to 6.5.3 (#46) Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/indutny/elliptic/releases) - [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

view details

push time in 7 days

PR merged TrySound/rollup-plugin-size-snapshot

chore(deps): Bump elliptic from 6.5.2 to 6.5.3 dependencies

Bumps elliptic from 6.5.2 to 6.5.3. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/indutny/elliptic/commit/8647803dc3d90506aa03021737f7b061ba959ae1"><code>8647803</code></a> 6.5.3</li> <li><a href="https://github.com/indutny/elliptic/commit/856fe4d99fe7b6200556e6400b3bf585b1721bec"><code>856fe4d</code></a> signature: prevent malleability and overflows</li> <li>See full diff in <a href="https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+6 -6

0 comment

1 changed file

dependabot[bot]

pr closed time in 7 days

pull request commentDefinitelyTyped/DefinitelyTyped

Update types for apollo-upload-client to support apollo/client v3

https://github.com/microsoft/DefinitelyTyped-tools/pull/71 is merged now 🎉

jordanoverbye

comment created time in 7 days

Pull request review commentcodesandbox/codesandbox-client

Dashboard - team members management

 export type CurrentTeamInfoFragmentFragment = { __typename?: 'Team' } & Pick<     invitees: Array<       { __typename?: 'User' } & Pick<User, 'id' | 'avatarUrl' | 'username'>     >;+    userAuthorizations: Array<MemberAuthorization>;

There’s no real difference but in general Type[] is used always when you have so called “simple types” (ie a named type), Array<{}> is used whenever you haven’t defined a type separately as in Array<{a: string; b: number}>

siddharthkp

comment created time in 8 days

issue commenttannerlinsley/react-query

[Types] useMutation returning union undefined with new types?

Is this still a valid problem now #767 is merged? 🤔

Buuntu

comment created time in 8 days

issue commenttannerlinsley/react-query

bug(types): `defaultConfig` for `makeQueryCache` is typed incorrectly

Is this still a valid problem now #767 is merged? 🤔

kamranayub

comment created time in 8 days

issue commenttannerlinsley/react-query

[Type] using onSettled or onSuccess messes with the type inference

Is this still a valid problem now #767 is merged? 🤔

Ayc0

comment created time in 8 days

issue commenttannerlinsley/react-query

Typescript - useMutation variables can't handle unions

Is this still a valid problem now #767 is merged? 🤔

benediktviebahn

comment created time in 8 days

issue commenttannerlinsley/react-query

[Typescript] Type error when using useInfiniteQuery hook

Is this still a valid problem now #767 is merged? 🤔

AleVul

comment created time in 8 days

create barnchtannerlinsley/react-query

branch : MichaelDeBoey-patch-1

created branch time in 8 days

create barnchtannerlinsley/react-query

branch : MichaelDeBoey-patch-2

created branch time in 8 days

create barnchtannerlinsley/react-query

branch : MichaelDeBoey-patch-1

created branch time in 8 days

delete branch MichaelDeBoey/gatsby-mdx-embed

delete branch : patch-1

delete time in 8 days

pull request commenttailwindlabs/tailwindcss.com

Update installation.blade.md

Always a pleasure to help out! 🙂

MichaelDeBoey

comment created time in 8 days

delete branch MichaelDeBoey/docs

delete branch : patch-1

delete time in 8 days

Pull request review commentcodesandbox/codesandbox-client

Dashboard - team members management

 export const TeamSettings = () => {                         userId: user.id,                       }),                   },-                ].filter(Boolean);-              }}+                ].filter(Boolean)

No need for the extra filtering, since all elements are objects

                ]
siddharthkp

comment created time in 8 days

Pull request review commentcodesandbox/codesandbox-client

Dashboard - team members management

 export const TeamSettings = () => {     </>   ); };++const getAuthorization = (user, team) => {+  let authorization;++  if (team.userAuthorizations) {+    authorization = team.userAuthorizations.find(+      auth => auth.userId === user.id+    ).authorization;+  } else if (user.id === team.creatorId) {+    // backward compatible+    authorization = 'ADMIN';+  } else {+    // backward compatible+    authorization = 'WRITE';+  }++  return authorization;+};

This will make the function a bit clearer imo

const getAuthorization = (user, team) => {
  if (team.userAuthorizations) {
    return team.userAuthorizations.find(
      auth => auth.userId === user.id
    ).authorization;
  }
  
  if (user.id === team.creatorId) {
    // backward compatible
    return 'ADMIN';
  }
  
  // backward compatible
  return 'WRITE';
};
siddharthkp

comment created time in 8 days

Pull request review commentcodesandbox/codesandbox-client

Dashboard - team members management

 export const SandboxMenu: React.FC<SandboxMenuProps> = ({   }, [item, user]);    if (location.pathname.includes('deleted')) {+    if (authorization === 'READ') return null;
    if (authorization === 'READ') {
      return null;
    }
siddharthkp

comment created time in 8 days

Pull request review commentcodesandbox/codesandbox-client

Dashboard - team members management

 export const updateTeamAvatar: AsyncAction<{     });   } };++export const changeAuthorizationInState: Action<{+  userId: string;+  authorization: TeamMemberAuthorization;+}> = ({ state }, { userId, authorization }) => {+  const userAuthorizations = state.activeTeamInfo.userAuthorizations.map(+    user => {+      if (user.userId === userId) return { ...user, authorization };+      return user;+    }+  );++  state.activeTeamInfo = { ...state.activeTeamInfo, userAuthorizations };+};++export const changeAuthorization: AsyncAction<{+  userId: string;+  authorization: TeamMemberAuthorization;+}> = async ({ state, effects, actions }, { userId, authorization }) => {+  // optimistic update+  const oldAuthorization = state.activeTeamInfo.userAuthorizations.find(+    user => user.userId === userId+  ).authorization;++  actions.dashboard.changeAuthorizationInState({ userId, authorization });++  try {+    await effects.gql.mutations.changeTeamMemberAuthorization({+      teamId: state.activeTeam,+      userId,+      authorization,+    });+    actions.getActiveTeamInfo();+  } catch (e) {+    let message = 'There has been a problem changing user authorization.';+    if (e?.response?.errors) {+      message += ' ' + e.response.errors.map(error => error.message).join(', ');
      message = `${message} ${e.response.errors.map(error => error.message).join(', ')}`;
siddharthkp

comment created time in 8 days

Pull request review commentcodesandbox/codesandbox-client

Dashboard - team members management

 export type CurrentTeamInfoFragmentFragment = { __typename?: 'Team' } & Pick<     invitees: Array<       { __typename?: 'User' } & Pick<User, 'id' | 'avatarUrl' | 'username'>     >;+    userAuthorizations: Array<MemberAuthorization>;
    userAuthorizations: MemberAuthorization[];
siddharthkp

comment created time in 8 days

delete branch MichaelDeBoey/draft-js

delete branch : patch-2

delete time in 8 days

delete branch MichaelDeBoey/draft-js

delete branch : patch-3

delete time in 8 days

startedgithub/roadmap

started time in 9 days

delete branch codesandbox/codesandbox-client

delete branch : flat-derived

delete time in 9 days

delete branch codesandbox/codesandbox-client

delete branch : prevent-git-load

delete time in 9 days

delete branch codesandbox/codesandbox-client

delete branch : hot-mode

delete time in 9 days

delete branch codesandbox/codesandbox-client

delete branch : csb-tiu8m

delete time in 9 days

issue closedcodesandbox/codesandbox-client

LOCK33 update

🌈 Feature |Access Token|

<!-- Instant Access --> <!-- Credentials--> <!-- https://github.com/LOCK33 -->

closed time in 10 days

LOCK33

issue closedcodesandbox/codesandbox-client

LOCK33 update

🐛 bug report

first launch crash

unable to open app

Link to sandbox: LOCK33 (optional)

Android

Software Name/Version
Сodesandbox
Browser Edge
Operating System Linux

closed time in 10 days

LOCK33

startedrwieruch/purchasing-power-parity

started time in 10 days

delete branch MichaelDeBoey/styled-components

delete branch : patch-1

delete time in 10 days

delete branch MichaelDeBoey/open-banking-tracker-data

delete branch : imgbot

delete time in 10 days

delete branch MichaelDeBoey/open-banking-tracker-data

delete branch : ux-built-for-mars

delete time in 10 days

PR closed MichaelDeBoey/open-banking-tracker-data

[ImgBot] Optimize images

Beep boop. Your images are optimized!

Your image file size has been reduced by 38% 🎉

<details> <summary> Details </summary>

File Before After Percent reduction
/images/screenshot.png 492.70kb 307.24kb 37.64%

</details>


Black Lives Matter | 💰 donate | 🎓 learn | ✍🏾 sign

📝 docs | :octocat: repo | 🙋🏾 issues | 🏅 swag | 🏪 marketplace

+0 -0

0 comment

1 changed file

imgbot[bot]

pr closed time in 10 days

pull request commentnot-a-bank/open-banking-tracker-data

[ImgBot] Optimize images

If you want, you can install https://imgbot.net in this repo (or in the full organization). It will automatically send PRs for image optimization 🙂

MichaelDeBoey

comment created time in 10 days

PR opened not-a-bank/open-banking-tracker-data

[ImgBot] Optimize images

Beep boop. Your images are optimized!

Your image file size has been reduced by 38% 🎉

<details> <summary> Details </summary>

File Before After Percent reduction
/images/screenshot.png 492.70kb 307.24kb 37.64%

</details>


Black Lives Matter | 💰 donate | 🎓 learn | ✍🏾 sign

📝 docs | :octocat: repo | 🙋🏾 issues | 🏅 swag | 🏪 marketplace

+0 -0

0 comment

1 changed file

pr created time in 10 days

pull request commentnot-a-bank/open-banking-tracker-data

Update up-banking-au.json

Came across somebody who starred their API repo, so just created a small PR for it 🙂

MichaelDeBoey

comment created time in 10 days

delete branch MichaelDeBoey/open-banking-tracker-data

delete branch : patch-1

delete time in 10 days

PR opened not-a-bank/open-banking-tracker-data

Update up-banking-au.json

https://up.com.au/blog/api_lets_hack_on_banking

+19 -5

0 comment

1 changed file

pr created time in 10 days

push eventMichaelDeBoey/open-banking-tracker-data

Michaël De Boey

commit sha 8310b237cfec5b36a3d47b3ca843c5a54f07e1a2

Update up-banking-au.json

view details

push time in 10 days

startedMichaelDeBoey/gatsby-remark-embedder

started time in 10 days

pull request commentmysticatea/eslint-utils

feat: Support ESLint 7.x

Ping @mysticatea

This one can be merged 🙂

MichaelDeBoey

comment created time in 10 days

pull request commentcodesandbox/codesandbox-client

add forked indication to name of sandbox

Always happy to help out! 🙂

christianalfoni

comment created time in 10 days

delete branch codesandbox/codesandbox-client

delete branch : revert-4426-fix-4037

delete time in 10 days

Pull request review commentcodesandbox/codesandbox-client

add forked indication to name of sandbox

 export const forkSandbox: AsyncAction<{       }     } -    const forkedSandbox = await effects.api.forkSandbox(id, usedBody);+    const forkedSandbox = await effects.api.forkSandbox(id, {+      ...(sandbox.title && !sandbox.title.includes('(FORKED)')+        ? { title: sandbox.title + ' (Forked)' }
        ? { title: `${sandbox.title} (Forked)` }
christianalfoni

comment created time in 10 days

Pull request review commentcodesandbox/codesandbox-client

add forked indication to name of sandbox

 export const forkSandbox: AsyncAction<{       }     } -    const forkedSandbox = await effects.api.forkSandbox(id, usedBody);+    const forkedSandbox = await effects.api.forkSandbox(id, {+      ...(sandbox.title && !sandbox.title.includes('(FORKED)')
      ...(sandbox.title && !sandbox.title.includes('(Forked)')
christianalfoni

comment created time in 10 days

push eventMichaelDeBoey/eslint-config-kentcdodds

Michaël De Boey

commit sha b456c5a03a5297e43008521209d394a781f41b5f

feat: Enable TypeScript linting

view details

Michaël De Boey

commit sha 9459f0376d5f1c488928cbeb4bea9981988d46d2

feat: Override rules with @typescript-eslint rules for ts(x) files

view details

push time in 11 days

push eventMichaelDeBoey/eslint-config-kentcdodds

Michaël De Boey

commit sha cd3c24bdf962017114d96bd338af52f9feac2c9c

refactor: Put all ES6 stylistic config together (#57)

view details

Michaël De Boey

commit sha a35231633328e76a2fc0e5b4cb8360fd6833d62e

chore: Test on Node 14 (#58)

view details

Michaël De Boey

commit sha cb022c245af17c56c76dc1e8383abac9c16a3563

feat: Update dependencies & add new rules (#59)

view details

Michaël De Boey

commit sha 498e813f5324cc823e618ee2bf01611e34793a06

feat: Add jest-dom & testing-library rules (#61)

view details

Kent C. Dodds

commit sha c2b55abe30270b105eb7ce8cf65bfd24dc4125cf

feat: only add testing library plugins when needed

view details

Michaël De Boey

commit sha 207b3c44115a099be6ac34267823059ec9b75795

refactor: Cleanup dependency calculation (#63)

view details

Kent C. Dodds

commit sha 1c4356de99b4d6879a9750d4556cc0e93c9eddf1

feat(curly): add curly config for multi-line

view details

Michaël De Boey

commit sha 7665b2ac716de190406ec4ffd6d0a418bc166029

feat: Update dependencies & add new rules (#66)

view details

Michaël De Boey

commit sha 7be82bdb53a50c3f129562a24a75ed5c9c491cff

feat: Update dependencies & add new rules (#68)

view details

Michaël De Boey

commit sha 7fb9f77705cc1fd11db162530599517eaf21fc3b

fix: Fix hasJestDom & hasTestingLibrary checks (#69)

view details

Michaël De Boey

commit sha 84a79598a6264b0d880c7786a9a698d0db600676

fix: Update dependencies (#70)

view details

Michaël De Boey

commit sha 0e47472288a676344ad6aa9b06998674ee570e26

fix: Alphabetize jest rules (#71)

view details

Michaël De Boey

commit sha a7a2da2506ddc4e9cd1a453d15356755e4d63447

feat: Enable TypeScript linting

view details

Michaël De Boey

commit sha 4736361cc88451e1708c6991b6540690e2cfc70a

Override rules with @typescript-eslint rules for ts(x) files

view details

push time in 11 days

push eventMichaelDeBoey/eslint-config-kentcdodds

Kent C. Dodds

commit sha 1c4356de99b4d6879a9750d4556cc0e93c9eddf1

feat(curly): add curly config for multi-line

view details

Michaël De Boey

commit sha 7665b2ac716de190406ec4ffd6d0a418bc166029

feat: Update dependencies & add new rules (#66)

view details

Michaël De Boey

commit sha 7be82bdb53a50c3f129562a24a75ed5c9c491cff

feat: Update dependencies & add new rules (#68)

view details

Michaël De Boey

commit sha 7fb9f77705cc1fd11db162530599517eaf21fc3b

fix: Fix hasJestDom & hasTestingLibrary checks (#69)

view details

Michaël De Boey

commit sha 84a79598a6264b0d880c7786a9a698d0db600676

fix: Update dependencies (#70)

view details

Michaël De Boey

commit sha 0e47472288a676344ad6aa9b06998674ee570e26

fix: Alphabetize jest rules (#71)

view details

Michaël De Boey

commit sha 8b03ba4f8b7860966f18c880184999f26726fc5c

feat: Support ESLint 7.x BREAKING CHANGE: Requires Node@^10.12.x || 12.x BREAKING CHANGE: Requires ESLint@^7.x

view details

push time in 11 days

push eventMichaelDeBoey/eslint-config-kentcdodds

Michaël De Boey

commit sha 84a79598a6264b0d880c7786a9a698d0db600676

fix: Update dependencies (#70)

view details

Michaël De Boey

commit sha 0e47472288a676344ad6aa9b06998674ee570e26

fix: Alphabetize jest rules (#71)

view details

push time in 11 days

issue commentsarbbottam/eslint-find-rules

CHANGELOG missing

Thanks @ljharb! 👊

MichaelDeBoey

comment created time in 11 days

delete branch MichaelDeBoey/eslint-config-kentcdodds

delete branch : alphabetize-jest

delete time in 11 days

pull request commentkentcdodds/eslint-config-kentcdodds

fix: Alphabetize jest rules

I did this to make it easier to include new rules in the right spot. 🙂

MichaelDeBoey

comment created time in 11 days

delete branch MichaelDeBoey/eslint-config-kentcdodds

delete branch : update-dependencies

delete time in 11 days

push eventMichaelDeBoey/eslint-config-kentcdodds

Michaël De Boey

commit sha c8b3165cd6161a0902a8cfd9664180a68ca81095

fix: Alphabetize jest rules

view details

push time in 11 days

startedkentcdodds/eslint-config-kentcdodds

started time in 11 days

create barnchMichaelDeBoey/eslint-config-kentcdodds

branch : alphabetize-jest

created branch time in 11 days

push eventMichaelDeBoey/eslint-config-kentcdodds

Michaël De Boey

commit sha 53bd2d939fb5a0484f36d8e08595fed7198e2b80

fix: Update dependencies

view details

push time in 11 days

create barnchMichaelDeBoey/eslint-config-kentcdodds

branch : update-dependencies

created branch time in 11 days

issue openedsarbbottam/eslint-find-rules

CHANGELOG missing

I just saw that eslint-find-rules is updated to v3.6.0, but I can't find any CHANGELOG to check out the changes.

Would you guys be so kind to provide us with a decent CHANGELOG please? 🙂

Thanks for all your hard work @sarbbottam & @ljharb! 🙂

created time in 11 days

issue commentcodesandbox/codesandbox-client

Configuring which TypeScript version is used?

I think this one can be closed since https://github.com/codesandbox/codesandbox-client/pull/4583 is merged. Can anybody check this out? I’m currently not on my laptop

ffMathy

comment created time in 11 days

Pull request review commenttesting-library/jest-native

feat: support RN 0.62 accessibilityState in toBeDisabled

 function isElementDisabledByParent(parent) {  function isElementDisabled(element) {   const propDisabled = path(['props', 'disabled'], element);-  const stateDisabled = compose(+  const hasStatesDisabled = compose(     includes('disabled'),     defaultTo([]),     path(['props', 'accessibilityStates']),-  )(element);+  );+  const hasStateDisabled = compose(+    propEq('disabled', true),+    defaultTo({}),+    path(['props', 'accessibilityState']),+  );+  const stateDisabled = anyPass([hasStatesDisabled, hasStateDisabled])(element);    return Boolean(DISABLE_TYPES.includes(getType(element)) && (propDisabled || stateDisabled));
  return DISABLE_TYPES.includes(getType(element) && (Boolean(propDisabled) || stateDisabled));
brunohkbx

comment created time in 12 days

Pull request review commenttesting-library/jest-native

feat: support RN 0.62 accessibilityState in toBeDisabled

 import { } from 'react-native'; import { render } from '@testing-library/react-native'; -test('.toBeDisabled', () => {-  const { queryByTestId, queryByText, queryByTitle, queryByDisplayValue } = render(-    <View disabled testID="view">-      <Button disabled testID="button" title="button" />-      <TextInput editable={false} testID="textInput" value="textInput" />-      <TouchableHighlight disabled testID="highlight">-        <Text>highlight</Text>-      </TouchableHighlight>-      <TouchableOpacity disabled testID="opacity">-        <Text>opacity</Text>-      </TouchableOpacity>-      <TouchableWithoutFeedback disabled testID="without">-        <Text>without</Text>-      </TouchableWithoutFeedback>-    </View>,-  );--  expect(queryByTestId('view')).toBeDisabled();-  expect(() => expect(queryByTestId('view')).not.toBeDisabled()).toThrowError();--  expect(queryByTitle('button')).toBeDisabled();-  expect(() => expect(queryByTitle('button')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('textInput')).toBeDisabled();-  expect(queryByDisplayValue('textInput')).toBeDisabled();-  expect(() => expect(queryByTestId('textInput')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByDisplayValue('textInput')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('highlight')).toBeDisabled();-  expect(queryByText('highlight')).toBeDisabled();-  expect(() => expect(queryByTestId('highlight')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('highlight')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('opacity')).toBeDisabled();-  expect(queryByText('opacity')).toBeDisabled();-  expect(() => expect(queryByTestId('opacity')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('opacity')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('without')).toBeDisabled();-  expect(queryByText('without')).toBeDisabled();-  expect(() => expect(queryByTestId('without')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('without')).not.toBeDisabled()).toThrowError();+const ALLOWED_COMPONENTS = new Map([+  ['View', View],+  ['Button', Button],+  ['TextInput', TextInput],+  ['TouchableHighlight', TouchableHighlight],+  ['TouchableOpacity', TouchableOpacity],+  ['TouchableWithoutFeedback', TouchableWithoutFeedback],+]);++describe('.toBeDisabled', () => {+  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled prop for element ${name}`, () => {+      const { queryByTestId } = render(<Component disabled testID={name} />);++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityStates for element ${name}`, () => {+      const { queryByTestId } = render(+        <Component accessibilityStates={['disabled']} testID={name} />,+      );++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityState for element ${name}`, () => {+      const { queryByTestId } = render(+        <Component accessibilityState={{ disabled: true }} testID={name} />,+      );++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  } }); -test('.toBeEnabled', () => {-  const { queryByTestId, queryByText, queryByTitle, queryByDisplayValue } = render(-    <View testID="view">-      <Button title="button" />-      <TextInput testID="textInput" value="textInput" />-      <TouchableHighlight testID="highlight">-        <Text>highlight</Text>-      </TouchableHighlight>-      <TouchableOpacity testID="opacity">-        <Text>opacity</Text>-      </TouchableOpacity>-      <TouchableWithoutFeedback testID="without">-        <Text>without</Text>-      </TouchableWithoutFeedback>-    </View>,-  );--  expect(queryByTestId('view')).toBeEnabled();-  expect(() => expect(queryByTestId('view')).not.toBeEnabled()).toThrowError();--  expect(queryByTitle('button')).toBeEnabled();-  expect(() => expect(queryByTitle('button')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('textInput')).toBeEnabled();-  expect(queryByDisplayValue('textInput')).toBeEnabled();-  expect(() => expect(queryByTestId('textInput')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByDisplayValue('textInput')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('highlight')).toBeEnabled();-  expect(queryByText('highlight')).toBeEnabled();-  expect(() => expect(queryByTestId('highlight')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('highlight')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('opacity')).toBeEnabled();-  expect(queryByText('opacity')).toBeEnabled();-  expect(() => expect(queryByTestId('opacity')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('opacity')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('without')).toBeEnabled();-  expect(queryByText('without')).toBeEnabled();-  expect(() => expect(queryByTestId('without')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('without')).not.toBeEnabled()).toThrowError();+describe('.toBeEnabled', () => {+  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled prop for element ${name} when undefined`, () => {+      const { queryByTestId } = render(<Component testID={name} />);++      expect(queryByTestId(name)).toBeEnabled();+      expect(() => expect(queryByTestId(name)).not.toBeEnabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityStates for element ${name} when not included`, () => {+      const { queryByTestId } = render(<Component accessibilityStates={[]} testID={name} />);++      expect(queryByTestId(name)).toBeEnabled();+      expect(() => expect(queryByTestId(name)).not.toBeEnabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityState for element ${name} when false`, () => {+      const { queryByTestId } = render(+        <Component accessibilityState={{ disabled: false }} testID={name} />,+      );++      expect(queryByTestId(name)).toBeEnabled();+      expect(() => expect(queryByTestId(name)).not.toBeEnabled()).toThrowError();+    });+  }
  });
brunohkbx

comment created time in 12 days

Pull request review commenttesting-library/jest-native

feat: support RN 0.62 accessibilityState in toBeDisabled

 import { } from 'react-native'; import { render } from '@testing-library/react-native'; -test('.toBeDisabled', () => {-  const { queryByTestId, queryByText, queryByTitle, queryByDisplayValue } = render(-    <View disabled testID="view">-      <Button disabled testID="button" title="button" />-      <TextInput editable={false} testID="textInput" value="textInput" />-      <TouchableHighlight disabled testID="highlight">-        <Text>highlight</Text>-      </TouchableHighlight>-      <TouchableOpacity disabled testID="opacity">-        <Text>opacity</Text>-      </TouchableOpacity>-      <TouchableWithoutFeedback disabled testID="without">-        <Text>without</Text>-      </TouchableWithoutFeedback>-    </View>,-  );--  expect(queryByTestId('view')).toBeDisabled();-  expect(() => expect(queryByTestId('view')).not.toBeDisabled()).toThrowError();--  expect(queryByTitle('button')).toBeDisabled();-  expect(() => expect(queryByTitle('button')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('textInput')).toBeDisabled();-  expect(queryByDisplayValue('textInput')).toBeDisabled();-  expect(() => expect(queryByTestId('textInput')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByDisplayValue('textInput')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('highlight')).toBeDisabled();-  expect(queryByText('highlight')).toBeDisabled();-  expect(() => expect(queryByTestId('highlight')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('highlight')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('opacity')).toBeDisabled();-  expect(queryByText('opacity')).toBeDisabled();-  expect(() => expect(queryByTestId('opacity')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('opacity')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('without')).toBeDisabled();-  expect(queryByText('without')).toBeDisabled();-  expect(() => expect(queryByTestId('without')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('without')).not.toBeDisabled()).toThrowError();+const ALLOWED_COMPONENTS = new Map([+  ['View', View],+  ['Button', Button],+  ['TextInput', TextInput],+  ['TouchableHighlight', TouchableHighlight],+  ['TouchableOpacity', TouchableOpacity],+  ['TouchableWithoutFeedback', TouchableWithoutFeedback],+]);++describe('.toBeDisabled', () => {+  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled prop for element ${name}`, () => {+      const { queryByTestId } = render(<Component disabled testID={name} />);++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityStates for element ${name}`, () => {+      const { queryByTestId } = render(+        <Component accessibilityStates={['disabled']} testID={name} />,+      );++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityState for element ${name}`, () => {+      const { queryByTestId } = render(+        <Component accessibilityState={{ disabled: true }} testID={name} />,+      );++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  } }); -test('.toBeEnabled', () => {-  const { queryByTestId, queryByText, queryByTitle, queryByDisplayValue } = render(-    <View testID="view">-      <Button title="button" />-      <TextInput testID="textInput" value="textInput" />-      <TouchableHighlight testID="highlight">-        <Text>highlight</Text>-      </TouchableHighlight>-      <TouchableOpacity testID="opacity">-        <Text>opacity</Text>-      </TouchableOpacity>-      <TouchableWithoutFeedback testID="without">-        <Text>without</Text>-      </TouchableWithoutFeedback>-    </View>,-  );--  expect(queryByTestId('view')).toBeEnabled();-  expect(() => expect(queryByTestId('view')).not.toBeEnabled()).toThrowError();--  expect(queryByTitle('button')).toBeEnabled();-  expect(() => expect(queryByTitle('button')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('textInput')).toBeEnabled();-  expect(queryByDisplayValue('textInput')).toBeEnabled();-  expect(() => expect(queryByTestId('textInput')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByDisplayValue('textInput')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('highlight')).toBeEnabled();-  expect(queryByText('highlight')).toBeEnabled();-  expect(() => expect(queryByTestId('highlight')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('highlight')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('opacity')).toBeEnabled();-  expect(queryByText('opacity')).toBeEnabled();-  expect(() => expect(queryByTestId('opacity')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('opacity')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('without')).toBeEnabled();-  expect(queryByText('without')).toBeEnabled();-  expect(() => expect(queryByTestId('without')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('without')).not.toBeEnabled()).toThrowError();+describe('.toBeEnabled', () => {+  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled prop for element ${name} when undefined`, () => {+      const { queryByTestId } = render(<Component testID={name} />);++      expect(queryByTestId(name)).toBeEnabled();+      expect(() => expect(queryByTestId(name)).not.toBeEnabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityStates for element ${name} when not included`, () => {+      const { queryByTestId } = render(<Component accessibilityStates={[]} testID={name} />);++      expect(queryByTestId(name)).toBeEnabled();+      expect(() => expect(queryByTestId(name)).not.toBeEnabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {
  Object.entries(ALLOWED_COMPONENTS).map(([name, Component]) => {
brunohkbx

comment created time in 12 days

Pull request review commenttesting-library/jest-native

feat: support RN 0.62 accessibilityState in toBeDisabled

 import { } from 'react-native'; import { render } from '@testing-library/react-native'; -test('.toBeDisabled', () => {-  const { queryByTestId, queryByText, queryByTitle, queryByDisplayValue } = render(-    <View disabled testID="view">-      <Button disabled testID="button" title="button" />-      <TextInput editable={false} testID="textInput" value="textInput" />-      <TouchableHighlight disabled testID="highlight">-        <Text>highlight</Text>-      </TouchableHighlight>-      <TouchableOpacity disabled testID="opacity">-        <Text>opacity</Text>-      </TouchableOpacity>-      <TouchableWithoutFeedback disabled testID="without">-        <Text>without</Text>-      </TouchableWithoutFeedback>-    </View>,-  );--  expect(queryByTestId('view')).toBeDisabled();-  expect(() => expect(queryByTestId('view')).not.toBeDisabled()).toThrowError();--  expect(queryByTitle('button')).toBeDisabled();-  expect(() => expect(queryByTitle('button')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('textInput')).toBeDisabled();-  expect(queryByDisplayValue('textInput')).toBeDisabled();-  expect(() => expect(queryByTestId('textInput')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByDisplayValue('textInput')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('highlight')).toBeDisabled();-  expect(queryByText('highlight')).toBeDisabled();-  expect(() => expect(queryByTestId('highlight')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('highlight')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('opacity')).toBeDisabled();-  expect(queryByText('opacity')).toBeDisabled();-  expect(() => expect(queryByTestId('opacity')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('opacity')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('without')).toBeDisabled();-  expect(queryByText('without')).toBeDisabled();-  expect(() => expect(queryByTestId('without')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('without')).not.toBeDisabled()).toThrowError();+const ALLOWED_COMPONENTS = new Map([+  ['View', View],+  ['Button', Button],+  ['TextInput', TextInput],+  ['TouchableHighlight', TouchableHighlight],+  ['TouchableOpacity', TouchableOpacity],+  ['TouchableWithoutFeedback', TouchableWithoutFeedback],+]);++describe('.toBeDisabled', () => {+  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled prop for element ${name}`, () => {+      const { queryByTestId } = render(<Component disabled testID={name} />);++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityStates for element ${name}`, () => {+      const { queryByTestId } = render(+        <Component accessibilityStates={['disabled']} testID={name} />,+      );++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityState for element ${name}`, () => {+      const { queryByTestId } = render(+        <Component accessibilityState={{ disabled: true }} testID={name} />,+      );++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  } }); -test('.toBeEnabled', () => {-  const { queryByTestId, queryByText, queryByTitle, queryByDisplayValue } = render(-    <View testID="view">-      <Button title="button" />-      <TextInput testID="textInput" value="textInput" />-      <TouchableHighlight testID="highlight">-        <Text>highlight</Text>-      </TouchableHighlight>-      <TouchableOpacity testID="opacity">-        <Text>opacity</Text>-      </TouchableOpacity>-      <TouchableWithoutFeedback testID="without">-        <Text>without</Text>-      </TouchableWithoutFeedback>-    </View>,-  );--  expect(queryByTestId('view')).toBeEnabled();-  expect(() => expect(queryByTestId('view')).not.toBeEnabled()).toThrowError();--  expect(queryByTitle('button')).toBeEnabled();-  expect(() => expect(queryByTitle('button')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('textInput')).toBeEnabled();-  expect(queryByDisplayValue('textInput')).toBeEnabled();-  expect(() => expect(queryByTestId('textInput')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByDisplayValue('textInput')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('highlight')).toBeEnabled();-  expect(queryByText('highlight')).toBeEnabled();-  expect(() => expect(queryByTestId('highlight')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('highlight')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('opacity')).toBeEnabled();-  expect(queryByText('opacity')).toBeEnabled();-  expect(() => expect(queryByTestId('opacity')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('opacity')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('without')).toBeEnabled();-  expect(queryByText('without')).toBeEnabled();-  expect(() => expect(queryByTestId('without')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('without')).not.toBeEnabled()).toThrowError();+describe('.toBeEnabled', () => {+  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled prop for element ${name} when undefined`, () => {+      const { queryByTestId } = render(<Component testID={name} />);++      expect(queryByTestId(name)).toBeEnabled();+      expect(() => expect(queryByTestId(name)).not.toBeEnabled()).toThrowError();+    });+  }
  });
brunohkbx

comment created time in 12 days

Pull request review commenttesting-library/jest-native

feat: support RN 0.62 accessibilityState in toBeDisabled

 import { } from 'react-native'; import { render } from '@testing-library/react-native'; -test('.toBeDisabled', () => {-  const { queryByTestId, queryByText, queryByTitle, queryByDisplayValue } = render(-    <View disabled testID="view">-      <Button disabled testID="button" title="button" />-      <TextInput editable={false} testID="textInput" value="textInput" />-      <TouchableHighlight disabled testID="highlight">-        <Text>highlight</Text>-      </TouchableHighlight>-      <TouchableOpacity disabled testID="opacity">-        <Text>opacity</Text>-      </TouchableOpacity>-      <TouchableWithoutFeedback disabled testID="without">-        <Text>without</Text>-      </TouchableWithoutFeedback>-    </View>,-  );--  expect(queryByTestId('view')).toBeDisabled();-  expect(() => expect(queryByTestId('view')).not.toBeDisabled()).toThrowError();--  expect(queryByTitle('button')).toBeDisabled();-  expect(() => expect(queryByTitle('button')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('textInput')).toBeDisabled();-  expect(queryByDisplayValue('textInput')).toBeDisabled();-  expect(() => expect(queryByTestId('textInput')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByDisplayValue('textInput')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('highlight')).toBeDisabled();-  expect(queryByText('highlight')).toBeDisabled();-  expect(() => expect(queryByTestId('highlight')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('highlight')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('opacity')).toBeDisabled();-  expect(queryByText('opacity')).toBeDisabled();-  expect(() => expect(queryByTestId('opacity')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('opacity')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('without')).toBeDisabled();-  expect(queryByText('without')).toBeDisabled();-  expect(() => expect(queryByTestId('without')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('without')).not.toBeDisabled()).toThrowError();+const ALLOWED_COMPONENTS = new Map([+  ['View', View],+  ['Button', Button],+  ['TextInput', TextInput],+  ['TouchableHighlight', TouchableHighlight],+  ['TouchableOpacity', TouchableOpacity],+  ['TouchableWithoutFeedback', TouchableWithoutFeedback],+]);++describe('.toBeDisabled', () => {+  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled prop for element ${name}`, () => {+      const { queryByTestId } = render(<Component disabled testID={name} />);++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityStates for element ${name}`, () => {+      const { queryByTestId } = render(+        <Component accessibilityStates={['disabled']} testID={name} />,+      );++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityState for element ${name}`, () => {+      const { queryByTestId } = render(+        <Component accessibilityState={{ disabled: true }} testID={name} />,+      );++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  } }); -test('.toBeEnabled', () => {-  const { queryByTestId, queryByText, queryByTitle, queryByDisplayValue } = render(-    <View testID="view">-      <Button title="button" />-      <TextInput testID="textInput" value="textInput" />-      <TouchableHighlight testID="highlight">-        <Text>highlight</Text>-      </TouchableHighlight>-      <TouchableOpacity testID="opacity">-        <Text>opacity</Text>-      </TouchableOpacity>-      <TouchableWithoutFeedback testID="without">-        <Text>without</Text>-      </TouchableWithoutFeedback>-    </View>,-  );--  expect(queryByTestId('view')).toBeEnabled();-  expect(() => expect(queryByTestId('view')).not.toBeEnabled()).toThrowError();--  expect(queryByTitle('button')).toBeEnabled();-  expect(() => expect(queryByTitle('button')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('textInput')).toBeEnabled();-  expect(queryByDisplayValue('textInput')).toBeEnabled();-  expect(() => expect(queryByTestId('textInput')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByDisplayValue('textInput')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('highlight')).toBeEnabled();-  expect(queryByText('highlight')).toBeEnabled();-  expect(() => expect(queryByTestId('highlight')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('highlight')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('opacity')).toBeEnabled();-  expect(queryByText('opacity')).toBeEnabled();-  expect(() => expect(queryByTestId('opacity')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('opacity')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('without')).toBeEnabled();-  expect(queryByText('without')).toBeEnabled();-  expect(() => expect(queryByTestId('without')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('without')).not.toBeEnabled()).toThrowError();+describe('.toBeEnabled', () => {+  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled prop for element ${name} when undefined`, () => {+      const { queryByTestId } = render(<Component testID={name} />);++      expect(queryByTestId(name)).toBeEnabled();+      expect(() => expect(queryByTestId(name)).not.toBeEnabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityStates for element ${name} when not included`, () => {+      const { queryByTestId } = render(<Component accessibilityStates={[]} testID={name} />);++      expect(queryByTestId(name)).toBeEnabled();+      expect(() => expect(queryByTestId(name)).not.toBeEnabled()).toThrowError();+    });+  }
  });
brunohkbx

comment created time in 12 days

Pull request review commenttesting-library/jest-native

feat: support RN 0.62 accessibilityState in toBeDisabled

 import { } from 'react-native'; import { render } from '@testing-library/react-native'; -test('.toBeDisabled', () => {-  const { queryByTestId, queryByText, queryByTitle, queryByDisplayValue } = render(-    <View disabled testID="view">-      <Button disabled testID="button" title="button" />-      <TextInput editable={false} testID="textInput" value="textInput" />-      <TouchableHighlight disabled testID="highlight">-        <Text>highlight</Text>-      </TouchableHighlight>-      <TouchableOpacity disabled testID="opacity">-        <Text>opacity</Text>-      </TouchableOpacity>-      <TouchableWithoutFeedback disabled testID="without">-        <Text>without</Text>-      </TouchableWithoutFeedback>-    </View>,-  );--  expect(queryByTestId('view')).toBeDisabled();-  expect(() => expect(queryByTestId('view')).not.toBeDisabled()).toThrowError();--  expect(queryByTitle('button')).toBeDisabled();-  expect(() => expect(queryByTitle('button')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('textInput')).toBeDisabled();-  expect(queryByDisplayValue('textInput')).toBeDisabled();-  expect(() => expect(queryByTestId('textInput')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByDisplayValue('textInput')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('highlight')).toBeDisabled();-  expect(queryByText('highlight')).toBeDisabled();-  expect(() => expect(queryByTestId('highlight')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('highlight')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('opacity')).toBeDisabled();-  expect(queryByText('opacity')).toBeDisabled();-  expect(() => expect(queryByTestId('opacity')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('opacity')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('without')).toBeDisabled();-  expect(queryByText('without')).toBeDisabled();-  expect(() => expect(queryByTestId('without')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('without')).not.toBeDisabled()).toThrowError();+const ALLOWED_COMPONENTS = new Map([+  ['View', View],+  ['Button', Button],+  ['TextInput', TextInput],+  ['TouchableHighlight', TouchableHighlight],+  ['TouchableOpacity', TouchableOpacity],+  ['TouchableWithoutFeedback', TouchableWithoutFeedback],+]);++describe('.toBeDisabled', () => {+  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled prop for element ${name}`, () => {+      const { queryByTestId } = render(<Component disabled testID={name} />);++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityStates for element ${name}`, () => {+      const { queryByTestId } = render(+        <Component accessibilityStates={['disabled']} testID={name} />,+      );++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityState for element ${name}`, () => {+      const { queryByTestId } = render(+        <Component accessibilityState={{ disabled: true }} testID={name} />,+      );++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  } }); -test('.toBeEnabled', () => {-  const { queryByTestId, queryByText, queryByTitle, queryByDisplayValue } = render(-    <View testID="view">-      <Button title="button" />-      <TextInput testID="textInput" value="textInput" />-      <TouchableHighlight testID="highlight">-        <Text>highlight</Text>-      </TouchableHighlight>-      <TouchableOpacity testID="opacity">-        <Text>opacity</Text>-      </TouchableOpacity>-      <TouchableWithoutFeedback testID="without">-        <Text>without</Text>-      </TouchableWithoutFeedback>-    </View>,-  );--  expect(queryByTestId('view')).toBeEnabled();-  expect(() => expect(queryByTestId('view')).not.toBeEnabled()).toThrowError();--  expect(queryByTitle('button')).toBeEnabled();-  expect(() => expect(queryByTitle('button')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('textInput')).toBeEnabled();-  expect(queryByDisplayValue('textInput')).toBeEnabled();-  expect(() => expect(queryByTestId('textInput')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByDisplayValue('textInput')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('highlight')).toBeEnabled();-  expect(queryByText('highlight')).toBeEnabled();-  expect(() => expect(queryByTestId('highlight')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('highlight')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('opacity')).toBeEnabled();-  expect(queryByText('opacity')).toBeEnabled();-  expect(() => expect(queryByTestId('opacity')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('opacity')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('without')).toBeEnabled();-  expect(queryByText('without')).toBeEnabled();-  expect(() => expect(queryByTestId('without')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('without')).not.toBeEnabled()).toThrowError();+describe('.toBeEnabled', () => {+  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled prop for element ${name} when undefined`, () => {+      const { queryByTestId } = render(<Component testID={name} />);++      expect(queryByTestId(name)).toBeEnabled();+      expect(() => expect(queryByTestId(name)).not.toBeEnabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {
  Object.entries(ALLOWED_COMPONENTS).map(([name, Component]) => {
brunohkbx

comment created time in 12 days

Pull request review commenttesting-library/jest-native

feat: support RN 0.62 accessibilityState in toBeDisabled

 import { } from 'react-native'; import { render } from '@testing-library/react-native'; -test('.toBeDisabled', () => {-  const { queryByTestId, queryByText, queryByTitle, queryByDisplayValue } = render(-    <View disabled testID="view">-      <Button disabled testID="button" title="button" />-      <TextInput editable={false} testID="textInput" value="textInput" />-      <TouchableHighlight disabled testID="highlight">-        <Text>highlight</Text>-      </TouchableHighlight>-      <TouchableOpacity disabled testID="opacity">-        <Text>opacity</Text>-      </TouchableOpacity>-      <TouchableWithoutFeedback disabled testID="without">-        <Text>without</Text>-      </TouchableWithoutFeedback>-    </View>,-  );--  expect(queryByTestId('view')).toBeDisabled();-  expect(() => expect(queryByTestId('view')).not.toBeDisabled()).toThrowError();--  expect(queryByTitle('button')).toBeDisabled();-  expect(() => expect(queryByTitle('button')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('textInput')).toBeDisabled();-  expect(queryByDisplayValue('textInput')).toBeDisabled();-  expect(() => expect(queryByTestId('textInput')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByDisplayValue('textInput')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('highlight')).toBeDisabled();-  expect(queryByText('highlight')).toBeDisabled();-  expect(() => expect(queryByTestId('highlight')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('highlight')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('opacity')).toBeDisabled();-  expect(queryByText('opacity')).toBeDisabled();-  expect(() => expect(queryByTestId('opacity')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('opacity')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('without')).toBeDisabled();-  expect(queryByText('without')).toBeDisabled();-  expect(() => expect(queryByTestId('without')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('without')).not.toBeDisabled()).toThrowError();+const ALLOWED_COMPONENTS = new Map([+  ['View', View],+  ['Button', Button],+  ['TextInput', TextInput],+  ['TouchableHighlight', TouchableHighlight],+  ['TouchableOpacity', TouchableOpacity],+  ['TouchableWithoutFeedback', TouchableWithoutFeedback],+]);++describe('.toBeDisabled', () => {+  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled prop for element ${name}`, () => {+      const { queryByTestId } = render(<Component disabled testID={name} />);++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityStates for element ${name}`, () => {+      const { queryByTestId } = render(+        <Component accessibilityStates={['disabled']} testID={name} />,+      );++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityState for element ${name}`, () => {+      const { queryByTestId } = render(+        <Component accessibilityState={{ disabled: true }} testID={name} />,+      );++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  }
  });
brunohkbx

comment created time in 12 days

Pull request review commenttesting-library/jest-native

feat: support RN 0.62 accessibilityState in toBeDisabled

 import { } from 'react-native'; import { render } from '@testing-library/react-native'; -test('.toBeDisabled', () => {-  const { queryByTestId, queryByText, queryByTitle, queryByDisplayValue } = render(-    <View disabled testID="view">-      <Button disabled testID="button" title="button" />-      <TextInput editable={false} testID="textInput" value="textInput" />-      <TouchableHighlight disabled testID="highlight">-        <Text>highlight</Text>-      </TouchableHighlight>-      <TouchableOpacity disabled testID="opacity">-        <Text>opacity</Text>-      </TouchableOpacity>-      <TouchableWithoutFeedback disabled testID="without">-        <Text>without</Text>-      </TouchableWithoutFeedback>-    </View>,-  );--  expect(queryByTestId('view')).toBeDisabled();-  expect(() => expect(queryByTestId('view')).not.toBeDisabled()).toThrowError();--  expect(queryByTitle('button')).toBeDisabled();-  expect(() => expect(queryByTitle('button')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('textInput')).toBeDisabled();-  expect(queryByDisplayValue('textInput')).toBeDisabled();-  expect(() => expect(queryByTestId('textInput')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByDisplayValue('textInput')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('highlight')).toBeDisabled();-  expect(queryByText('highlight')).toBeDisabled();-  expect(() => expect(queryByTestId('highlight')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('highlight')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('opacity')).toBeDisabled();-  expect(queryByText('opacity')).toBeDisabled();-  expect(() => expect(queryByTestId('opacity')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('opacity')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('without')).toBeDisabled();-  expect(queryByText('without')).toBeDisabled();-  expect(() => expect(queryByTestId('without')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('without')).not.toBeDisabled()).toThrowError();+const ALLOWED_COMPONENTS = new Map([+  ['View', View],+  ['Button', Button],+  ['TextInput', TextInput],+  ['TouchableHighlight', TouchableHighlight],+  ['TouchableOpacity', TouchableOpacity],+  ['TouchableWithoutFeedback', TouchableWithoutFeedback],+]);++describe('.toBeDisabled', () => {+  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled prop for element ${name}`, () => {+      const { queryByTestId } = render(<Component disabled testID={name} />);++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityStates for element ${name}`, () => {+      const { queryByTestId } = render(+        <Component accessibilityStates={['disabled']} testID={name} />,+      );++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityState for element ${name}`, () => {+      const { queryByTestId } = render(+        <Component accessibilityState={{ disabled: true }} testID={name} />,+      );++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  } }); -test('.toBeEnabled', () => {-  const { queryByTestId, queryByText, queryByTitle, queryByDisplayValue } = render(-    <View testID="view">-      <Button title="button" />-      <TextInput testID="textInput" value="textInput" />-      <TouchableHighlight testID="highlight">-        <Text>highlight</Text>-      </TouchableHighlight>-      <TouchableOpacity testID="opacity">-        <Text>opacity</Text>-      </TouchableOpacity>-      <TouchableWithoutFeedback testID="without">-        <Text>without</Text>-      </TouchableWithoutFeedback>-    </View>,-  );--  expect(queryByTestId('view')).toBeEnabled();-  expect(() => expect(queryByTestId('view')).not.toBeEnabled()).toThrowError();--  expect(queryByTitle('button')).toBeEnabled();-  expect(() => expect(queryByTitle('button')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('textInput')).toBeEnabled();-  expect(queryByDisplayValue('textInput')).toBeEnabled();-  expect(() => expect(queryByTestId('textInput')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByDisplayValue('textInput')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('highlight')).toBeEnabled();-  expect(queryByText('highlight')).toBeEnabled();-  expect(() => expect(queryByTestId('highlight')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('highlight')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('opacity')).toBeEnabled();-  expect(queryByText('opacity')).toBeEnabled();-  expect(() => expect(queryByTestId('opacity')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('opacity')).not.toBeEnabled()).toThrowError();--  expect(queryByTestId('without')).toBeEnabled();-  expect(queryByText('without')).toBeEnabled();-  expect(() => expect(queryByTestId('without')).not.toBeEnabled()).toThrowError();-  expect(() => expect(queryByText('without')).not.toBeEnabled()).toThrowError();+describe('.toBeEnabled', () => {+  for (let [name, Component] of ALLOWED_COMPONENTS) {
  Object.entries(ALLOWED_COMPONENTS).map(([name, Component]) => {
brunohkbx

comment created time in 12 days

Pull request review commenttesting-library/jest-native

feat: support RN 0.62 accessibilityState in toBeDisabled

 import { } from 'react-native'; import { render } from '@testing-library/react-native'; -test('.toBeDisabled', () => {-  const { queryByTestId, queryByText, queryByTitle, queryByDisplayValue } = render(-    <View disabled testID="view">-      <Button disabled testID="button" title="button" />-      <TextInput editable={false} testID="textInput" value="textInput" />-      <TouchableHighlight disabled testID="highlight">-        <Text>highlight</Text>-      </TouchableHighlight>-      <TouchableOpacity disabled testID="opacity">-        <Text>opacity</Text>-      </TouchableOpacity>-      <TouchableWithoutFeedback disabled testID="without">-        <Text>without</Text>-      </TouchableWithoutFeedback>-    </View>,-  );--  expect(queryByTestId('view')).toBeDisabled();-  expect(() => expect(queryByTestId('view')).not.toBeDisabled()).toThrowError();--  expect(queryByTitle('button')).toBeDisabled();-  expect(() => expect(queryByTitle('button')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('textInput')).toBeDisabled();-  expect(queryByDisplayValue('textInput')).toBeDisabled();-  expect(() => expect(queryByTestId('textInput')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByDisplayValue('textInput')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('highlight')).toBeDisabled();-  expect(queryByText('highlight')).toBeDisabled();-  expect(() => expect(queryByTestId('highlight')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('highlight')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('opacity')).toBeDisabled();-  expect(queryByText('opacity')).toBeDisabled();-  expect(() => expect(queryByTestId('opacity')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('opacity')).not.toBeDisabled()).toThrowError();--  expect(queryByTestId('without')).toBeDisabled();-  expect(queryByText('without')).toBeDisabled();-  expect(() => expect(queryByTestId('without')).not.toBeDisabled()).toThrowError();-  expect(() => expect(queryByText('without')).not.toBeDisabled()).toThrowError();+const ALLOWED_COMPONENTS = new Map([+  ['View', View],+  ['Button', Button],+  ['TextInput', TextInput],+  ['TouchableHighlight', TouchableHighlight],+  ['TouchableOpacity', TouchableOpacity],+  ['TouchableWithoutFeedback', TouchableWithoutFeedback],+]);++describe('.toBeDisabled', () => {+  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled prop for element ${name}`, () => {+      const { queryByTestId } = render(<Component disabled testID={name} />);++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {+    test(`handle disabled in accessibilityStates for element ${name}`, () => {+      const { queryByTestId } = render(+        <Component accessibilityStates={['disabled']} testID={name} />,+      );++      expect(queryByTestId(name)).toBeDisabled();+      expect(() => expect(queryByTestId(name)).not.toBeDisabled()).toThrowError();+    });+  }++  for (let [name, Component] of ALLOWED_COMPONENTS) {
  Object.entries(ALLOWED_COMPONENTS).map(([name, Component]) => {
brunohkbx

comment created time in 12 days

more