Code Monkey home page Code Monkey logo

example-trellix's Introduction

npm i
npx prisma migrate dev
npm run dev

example-trellix's People

Contributors

ryanflorence avatar ryanleichty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

example-trellix's Issues

How would you test cookies?

Hi! In my company, we're using Remix, and we're making more or less the same approach of auth with Cookies, but haven't been able to test it correctly. We're trying to test that a loader has a cookie that an action has previously set with: redirect("/", {headers: {"Set-Cookie": "cookie=foo"}}). The problem is that the loader doesn't receive any cookie, and it has been impossible to test it using remixStub.

Testing auth is very important for us, but ideally, we don't want to start using an e2e tool such as playwright because Vitest (+ happy-dom) is way faster, is there anything you think we might be missing or do you have any comment?

Furthermore, it would be awesome if you show us how would you to test these kinds of examples!

Error in onBlur Event Handling for EditableText Component

The EditableText component is currently experiencing an error when handling the onBlur event. The intended functionality is for the onBlur event to trigger fetcher.submit, but instead, it produces the following error message: "Uncaught Error: Cannot submit element that is not <form>, <button>, or <input type='submit|image'>" in the console. Additionally, fetcher.submit does not trigger unless the user presses the Enter key after typing.

Observations:

  • The use of event.currentTarget selects the input field rather than the form, potentially causing the error.
  • While the onBlur event is meant to trigger fetcher.submit under certain conditions, the current implementation fails to do so.
  • The error message indicates that the element being submitted does not meet the required criteria of <form>, <button>, or <input type='submit|image'>.
  • Notably, the onSubmit functionality works as expected when the user presses Enter after typing.

Code Snippet:

onBlur={(event) => {
  if (
    inputRef.current?.value !== value &&
    inputRef.current?.value.trim() !== ""
  ) {
    fetcher.submit(event.currentTarget);
  }
  setEdit(false);
}}

Proposed Solution:

onBlur={(event) => {
  if (
    inputRef.current?.value !== value &&
    inputRef.current?.value.trim() !== ""
  ) {
    fetcher.submit(event.currentTarget.parentElement as HTMLFormElement);
  }
  setEdit(false);
}}

Note:
I'm uncertain if the current behavior aligns with the intended use of the component. I'm still learning and would appreciate clarification on whether this behavior is intentional. If it's not can I create a PR?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.