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

Add Tests For Solid Toast #15

Open
ardeora opened this issue Jul 15, 2022 · 3 comments
Open

Add Tests For Solid Toast #15

ardeora opened this issue Jul 15, 2022 · 3 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ardeora
Copy link
Owner

ardeora commented Jul 15, 2022

There are multiple combinations of ways to use/configure solid-toast. We need to add tests to make sure the configuration follows the correct hierarchy and manages edge cases correctly.

@ardeora ardeora added help wanted Extra attention is needed good first issue Good for newcomers labels Jul 15, 2022
@ardeora ardeora changed the title Add Tests For Solid Toasts Add Tests For Solid Toast Jul 15, 2022
@InerkyJad
Copy link

InerkyJad commented Aug 18, 2022

Do you refer to unit tests (for certain functions....), or end-2-end tests for the full functionality ? is jest / cypress what you're looking for respectively.

@ardeora
Copy link
Owner Author

ardeora commented Aug 21, 2022

Apologies for the late reply. Been talking a break from some of the projects this week. I believe my concern recently has been while making changes/updates to the core API, I want to make sure that backwards compatibility is correctly preserved.

The current pain points that I can recognise right now is that solid-toast allows users to define the default behaviour of the toasts by passing props to the Toaster component. These default configuration should still be overridden by the call-site toast function. For example,

// Toaster config setting all toasts to have a default duration of 3secs
<Toaster 
  toastOptions={{
    duration: 3000
  }}
/>

// Call-Site toast invocation that overrides the 3 seconds default
toast('Hello, World', {
  duration: 6000
})

Along with this. Different toast types have different default durations if nothing is configured https://github.com/ardeora/solid-toast/blob/main/src/core/defaults.ts#L4-L10. These defaults should only be applied if the Toaster Component/toast function do not provide any duration.

So as per priority goes. Having Jest unit tests that test different edge cases and configuration permutations would be a first good step for making the library resilient to most common source of bugs. End-To-End tests would be awesome to have but that is something that can be put in the nice-to-haves list. Hope this answers your question :D

@InerkyJad
Copy link

Thank you, yes it does, I haven't checked the full codebase yet since I wasn't sure I'll be working on this, tomorrow i'll start and whenever i'm done, i'll send a pull-request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants