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

onRestError failures hidden #584

Open
tuckerzp opened this issue Aug 24, 2022 · 3 comments
Open

onRestError failures hidden #584

tuckerzp opened this issue Aug 24, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@tuckerzp
Copy link
Contributor

Also, it looks like the failure above highlights an issue with the onRestError prop that we're using... somewhere we're failing to actually pass a function.

FAIL src/components/OSCALJsonEditor.test.js
  ● OSCALJsonEditor › should render as expected

    TypeError: props.onRestError is not a function



      at src/components/OSCALControlProse.js:605:23
      at src/components/oscal-utils/OSCALRestUtils.js:153:13

  ● OSCALJsonEditor › should render as expected

    TypeError: props.onRestError is not a function



      at src/components/OSCALControlProse.js:605:23
      at src/components/oscal-utils/OSCALRestUtils.js:153:13

  ● OSCALJsonEditor › should render as expected

    TypeError: props.onRestError is not a function



      at src/components/OSCALControlProse.js:605:23
      at src/components/oscal-utils/OSCALRestUtils.js:153:13

  ● OSCALJsonEditor › should render as expected

    TypeError: props.onRestError is not a function



      at src/components/OSCALControlProse.js:605:23
      at src/components/oscal-utils/OSCALRestUtils.js:153:13

  ● OSCALJsonEditor › should return JSON after clicking save

    connect ECONNREFUSED 127.0.0.1:80



  ● OSCALJsonEditor › should return JSON after clicking save

    connect ECONNREFUSED 127.0.0.1:80



  ● OSCALJsonEditor › should return JSON after clicking save

    connect ECONNREFUSED 127.0.0.1:80



  ● OSCALJsonEditor › should return JSON after clicking save

    connect ECONNREFUSED 127.0.0.1:80

This probably would have been prevented with stronger type checking. In any case, if it's trivial, we can fix it here. Otherwise, we should we probably open a separate issue.

Originally posted by @kylelaker in #581 (comment)

@tuckerzp tuckerzp added the bug Something isn't working label Aug 24, 2022
@brian-comply0
Copy link
Contributor

Must specify React component property types before we can size or work this.

@brian-comply0
Copy link
Contributor

brian-comply0 commented May 1, 2023

@kylelaker do we have an issue for specifying React component property types that we can cite in the comment above?

@tuckerzp
Copy link
Contributor Author

tuckerzp commented May 1, 2023

It looks like the logs we originally cited this from are gone. I agree with @kylelaker's original thought that progressively switching toTypeScript will lead to this issue being fixed.

If I had to guess, switching OSCALJsonEditor.test.js --> OSCALJsonEditor.test.tsx might be a good starting point. But it may not be worth the effort to actively try to replicate this bug if it just effects the tests and will naturally be fixed anyways.

do we have an issue for specifying React component property types that we can cite in the comment above?

I don't think we do but I also don't think adding one would provide a ton of value. So far, we have just been adding property type specifications when we switch files to TypeScript. Rather than having one big issue that touches the entire code base, it has made more sense to just use the boy scout rule when we make changes in various files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants