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 integration tests #14

Open
ElliotFriend opened this issue Sep 25, 2024 · 32 comments
Open

Add integration tests #14

ElliotFriend opened this issue Sep 25, 2024 · 32 comments
Labels
ODHack9 Issues eligible for the OnlyDust hackathon

Comments

@ElliotFriend
Copy link
Contributor

This project has no tests written for it. That should be rectified. When creating a new SvelteKit project, you can optionally create structure for integration tests using playwright or unit tests using vitest. So, those seem like decent options for us to use here.

Integration tests should be written for the components and pages? Not really sure. I'm not very familiar with writing integration tests for Svelte(Kit) apps, so I'm not exactly sure of the scope for this.

@ElliotFriend ElliotFriend added the ODHack8 Issues eligible for the OnlyDust hackathon label Sep 25, 2024
@CollinsC1O
Copy link

hello @ElliotFriend I'm a frontend and also a blockchain developer. I will love to work on this please

Copy link

onlydustapp bot commented Sep 25, 2024

Hi @CollinsC1O!
Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust.
Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

@Dprof-in-tech
Copy link

Dprof-in-tech commented Sep 26, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello, i am Dprof-in-tech, an experienced Full Stack Blockchain Developer and I am excited to contribute my skills to this project in this ODHACK 8. With a strong background in Next.js, TypeScript, JavaScript, React, Node.js, Rust and Cairo, I've honed my technical skills across the blockchain development landscape.

My journey with OnlyDust began at Edition 2, and I've since made 34 contributions across 11 projects. This extensive experience on the platform has allowed me to develop a keen understanding of delivering high-quality solutions under tight deadlines.
Due to my web2 experience, i am skilled in writing unit tests and have used Jest and Vitest to do this. I would love to contribute to this project by solving this issue.

Below is a link to my OnlyDust public profile.
https://app.onlydust.com/u/Dprof-in-tech

How I plan on tackling this issue

Here is the approach i would use in building a solution to this issue while focusing on writing standard unit tests.

  1. First things first, gotta set up Vitest. It's pretty straightforward:

  2. Now, I'll go through /src/lib/stellar/* and /src/lib/utils.js, make a list of all the exported functions, and decide which ones are the most important or complex. Those are the ones I'll tackle first.

  3. For each file, I'll make a matching test file right next to it. So like, utils.js gets a utils.test.js buddy.

  4. Writing the actual tests is where the fun begins:

    • Start simple: just check if the function exists
    • Test the normal inputs and outputs
    • Throw some weird stuff at it (empty inputs, huge numbers, etc.)
    • Make sure it doesn't fall apart when something goes wrong
  5. If a function is calling APIs or doing something I can't easily test, I'll mock that stuff out. No need to actually hit external services for unit tests.

  6. I want to know how much of my code I'm actually testing, so I'll set up coverage:

  7. I'll start with the easy functions and work my way up to the trickier ones. Utilities are super important, so I'll make sure those are rock solid.

  8. To keep things organized, I'll use describe blocks. Group tests for each function, and if a function has different scenarios, I'll nest describe blocks.

  9. Once I've got a decent set of tests, I'll set up GitHub Actions to run them on every commit. No broken code sneaking into main!

  10. Last but not least, I've gotta keep these tests up to date. When I change a function, I update its tests. New function? New tests. And every now and then, I'll go through and clean up the tests to keep them running smooth.

I believe with this approach and your essential code review, id give the perfect solution to this issue.

@jimenezz22
Copy link
Contributor

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am an active member of the Dojo Coding community in Costa Rica, with experience in Cairo, having built onchain games like ByteBeasts and contributed to open-source projects such as CairoLint, where I implemented tests for Cairo lints. Additionally, I taught Cairo during the Starknet Bootcamp for Dojo Coding. I also have experience with TypeScript, contributing to Starknet Quest by developing components like ComboBoxes, among others.

How I plan on tackling this issue

Approach for the Issue:

  1. Set Up Playwright: I'll set up Playwright for integration testing, which is well-suited for SvelteKit apps, especially for user interactions and navigation.
  2. Identify Key Components/Pages: I’ll review the project to identify crucial payment components and pages, such as the checkout process and transaction confirmations.
  3. Write Integration Tests:
    • Basic Flow: Test payment submissions, form validation, and transaction result displays.
    • Navigation: Ensure smooth navigation between different payment-related pages.
    • Error Handling: Test invalid inputs and payment failures, ensuring proper error messaging.
  4. Test Setup/Cleanup: Implement processes to isolate tests and prevent state conflicts between them.
  5. Refine Scope: Start with core payment flows and expand test coverage as needed.

Estimated Time: 3-4 days

@mariocodecr
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hii! My name is Mario Araya, I’m a Software Developer with 2+ years of experience. I have worked with backend technologies such as Cairo, Java, and C#, as well as frontend development using React, NextJS, and JavaScript/TypeScript. I’ve made contributions to open-source projects, completed a Starknet Bootcamp, exercises on NodeGuardians, finished Starklings, and participated in multiple hackathons. I’m also a member of the Dojo Coding community here in Costa Rica.

How I plan on tackling this issue

Set Up Testing Frameworks:
I would start by configuring the project to include either Playwright for integration tests or Vitest for unit tests. This can be done by following the documentation for integrating these testing frameworks into a SvelteKit project.

Understand Test Scope:
Since you’re not familiar with writing integration tests for SvelteKit, I would review the components and pages within the project to determine which parts are crucial to test. Typically, integration tests should cover:

Core Components: Ensure that key components render correctly and interact as expected.
Pages: Validate the behavior of pages when navigating through the app, ensuring the correct components load and user interactions work.
Write Integration Tests:
I would begin writing integration tests for important user flows, such as:

Rendering specific components on the page.
Checking if user interactions (like clicks or form submissions) produce the expected outcomes.
Verifying that the app maintains the correct state after interactions.
Create Unit Tests:
If using Vitest, I would write unit tests for smaller functions or components that don’t require a full application context. This may include testing:

Utility functions.
Individual component logic to ensure props and state management work as intended.
Documentation and Learning Resources:
Since you're not very familiar with SvelteKit testing, I would look for tutorials, documentation, or examples specifically related to testing in SvelteKit to help guide the process. The official documentation for both Playwright and Vitest would be good starting points.

Run Tests:
After implementing the tests, I would run them to ensure they pass and provide the expected coverage for the project.

Refactor and Expand:
If time permits, I would refactor existing components and pages to enhance testability, and I’d continue to expand the test suite as needed based on feedback or further understanding of the application’s requirements.

@gregemax
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have a background in JavaScript and experience with Playwright and Vitest for test my testing skills will help implement effective integration tests for the project

How I plan on tackling this issue

I would set up Playwright for integration testing, identify key user interactions in the SvelteKit app, and start by writing tests for the most critical components and pages, gradually expanding coverage as I learn more about the framework.

@thesledge04
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have a background in developing applications using various frameworks, which gives me insight into testing best practices. While I may not have extensive experience with Svelte(Kit), I can leverage my knowledge of unit and integration testing principles from other frameworks.

How I plan on tackling this issue

Choose Playwright for integration tests and set it up.
Define test scope focusing on user flows and components.
Write and validate test cases for critical paths.
Run tests regularly during development.
Document the testing process for clarity.

@martinvibes
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

hello i am a frontend dev and blockchain developer
please can i work on this issue :) and would love to be a contributor

How I plan on tackling this issue

Issue Summary:
Problem: The project currently lacks tests, which needs to be addressed.
Action Items:
Add Integration Tests:

Write integration tests for the components and pages of the project. Tools like Playwright (for integration tests) or Vitest (for unit tests) are recommended since they can be set up with new SvelteKit projects.
Determine Scope:

Clarify the scope of the integration tests. Focus on testing the behavior of components and pages, ensuring that they work as intended within the app.
Recommended Tools:

Playwright: For end-to-end and integration testing.
Vitest: For unit tests, though the main focus here seems to be integration.

@Nemezjusz
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have extensive experience in software testing within the telecom industry, focusing on both manual and automated testing for complex systems.

How I plan on tackling this issue

I would start by auditing the code in /src/lib/stellar/* and /src/lib/utils.js to identify key functions for unit testing. Also i would implement integration tests to simulate user interactions and ensure seamless component integration.

@josephchimebuka
Copy link
Contributor

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello @ElliotFriend I am Joseph I am a Software developer and blockchain developer and I am also an active contributor here on only dust here is my profile https://app.onlydust.com/u/josephchimebuka. This is my first time to contribute to this repo ill appreciate the opportunity to contribute.

How I plan on tackling this issue

To solve this, I will first decide between using Playwright for integration tests or Vitest for unit tests based on the project needs. Since integration tests are required for components and pages, I will review Playwright's documentation for guidance on writing integration tests specifically for SvelteKit. I'll then set up the project to include test structure, ensuring that components and pages are tested in real user scenarios. For unit testing, I will use Vitest to ensure individual functions work correctly. If uncertain about the scope of integration tests, I’ll start by testing key user interactions and gradually expand coverage as necessary.

@jimenezz22
Copy link
Contributor

thanks @ElliotFriend for assigning me the issue, I will start working asap

@ElliotFriend
Copy link
Contributor Author

Hi, @jimenezz22 ! Thanks for the interest in this issue. Since I haven't seen a PR yet for this issue, and there's still some work your in the middle of on the unit tests PR, I'm going to un-assign this one and make it available for ODHack9. You should definitely feel free to apply again, though!

Thanks again!

@ElliotFriend ElliotFriend added ODHack9 Issues eligible for the OnlyDust hackathon and removed ODHack8 Issues eligible for the OnlyDust hackathon labels Oct 24, 2024
@suhas-sensei
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

can i work on this?

@Jemiiah
Copy link

Jemiiah commented Oct 24, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello @ElliotFriend I'm a frontend web 3 developer I have good experience in tackling OD Hack issue and this is my first time on this repository I have read the issue and understood what needs to be, hope to get assigned here is my GitHub profile : https://github.com/Jemiiah as well as my onlydust profile : https://app.onlydust.com/u/Jemiiah

How I plan on tackling this issue

First things first, gotta set up Vitest. It's pretty straightforward:

Now, I'll go through /src/lib/stellar/* and /src/lib/utils.js, make a list of all the exported functions, and decide which ones are the most important or complex. Those are the ones I'll tackle first.

For each file, I'll make a matching test file right next to it. So like, utils.js gets a utils.test.js buddy.

Writing the actual tests is where the fun begins:

Start simple: just check if the function exists
Test the normal inputs and outputs
Throw some weird stuff at it (empty inputs, huge numbers, etc.)
Make sure it doesn't fall apart when something goes wrong
If a function is calling APIs or doing something I can't easily test, I'll mock that stuff out. No need to actually hit external services for unit tests.

I want to know how much of my code I'm actually testing, so I'll set up coverage:

I'll start with the easy functions and work my way up to the trickier ones. Utilities are super important, so I'll make sure those are rock solid.

To keep things organized, I'll use describe blocks. Group tests for each function, and if a function has different scenarios, I'll nest describe blocks.

Once I've got a decent set of tests, I'll set up GitHub Actions to run them on every commit. No broken code sneaking into main!

Last but not least, I've gotta keep these tests up to date. When I change a function, I update its tests. New function? New tests. And every now and then, I'll go through and clean up the tests to keep them running smooth.

@aniruddhaaps
Copy link

I'm a javascript dev. A new-comer here, willing and ready to contribute to solve the issue.

@juandiegocv27
Copy link

juandiegocv27 commented Oct 24, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged:

Hey @ElliotFriend! I'm Juan Diego, and I bring a mix of interesting experience to the table. Right now I'm working on ByteBeasts (it's this cool on-chain RPG game) and I'm part of the Dojo Coding community. My daily tools are Rust, JavaScript, and TypeScript, and I've gotten pretty good at unit testing through my remote work experience. I've been involved in several Web3 and blockchain open-source projects, which gives me good context for working on this Stellar payment app.

How I plan on tackling this issue

  1. Testing Framework Setup

    • Setting up Vitest for unit tests and Playwright for integration tests, aligned with SvelteKit's best practices.
  2. Component Analysis

    • Going through /src/lib/stellar/ and /src/lib/utils.js to map out what needs testing.
  3. Test Development

    • Creating unit tests with Vitest for the utility functions - checking normal cases, edge cases, the works.
    • Building integration tests with Playwright to check real user flows like payments and form submissions.
  4. API Mocking

    • Setting up mocks for external APIs to keep tests reliable and independent.
  5. Automation Setup

    • Getting GitHub Actions running to test every commit, plus adding coverage tracking.
  6. Maintenance Plan

    • Keeping tests up to date as the code grows, making sure everything stays efficient.

ETA: 3-4 days. Let me know if you'd like me to clarify anything about my approach!

@Benjtalkshow
Copy link

I am a Full Stack Developer specializing in Next.js, TypeScript, Node.js, Cairo and Rust . With over 31 contributions across projects in the OnlyDust ecosystem, I’ve developed strong proficiency in delivering high-quality solutions and resolving complex issues within tight deadlines. My experience spans frontend, backend, smart contracts, and the optimization and maintenance of scalable codebases.

The goal is to implement integration tests across critical components and pages. Integration tests differ from unit tests in that they evaluate how various modules work together in the actual application environment, making them particularly well-suited for SvelteKit, where components and pages interact closely.

Here is how i plan to tackle this issue:
Since we can add support for integration tests for this SvelteKit project, leveraging Playwright would be ideal solutions. Playwright is the more suitable choice for integration tests. It gives a broader scope by simulating real-world use cases, including how pages and components work together.

Here is how i plan to tackle this issue:

  1. The first step in implementing these tests would be setting up Playwright, configuring it to work seamlessly with this SvelteKit app. This involves defining the base URL and setting up the environment for headless testing, which will run the tests in a faster, automated way without needing a graphical browser interface.
  2. Once configured, I will write integration tests that focus on both the components and the pages of the app. The tests will verify that key user flows such as navigation between pages, form submissions, and component functionality work correctly.
  3. For example, we could write tests that simulate a user visiting the home page, checking that it displays the correct content, and navigating to other pages like "About" or "Contact." Additional tests would cover more complex interactions, such as filling out forms and verifying that the correct success or error messages are displayed based on the input. These tests will ensure that both individual components and the app as a whole are functioning as expected in real-world scenarios.

Finally, to maintain ongoing quality, I will integrate these tests into the project’s Continuous Integration/Continuous Deployment (CI/CD) pipeline, ensuring they run automatically with each update. As the app grows, new tests will be written to cover new features, ensuring high test coverage and robust user experiences. By using Playwright, we will establish a solid testing foundation that reduces the risk of bugs and improves the overall maintainability of the project.

@Kaminar-i
Copy link

Please, I would really love to solve this issue

@Akshola00
Copy link

Is this issue still available?

@Yunusabdul38
Copy link

i have a solid knowledge in both frontend and smart contract test, I'd like to handle this task.

@deeseeker
Copy link

Could I take over this issue?

@jedstroke
Copy link

I'd like to take this issue.

@mimisavage
Copy link

I’m interested in this one.

@Akshola00
Copy link

Id like to handle this issue

@Dprof-in-tech
Copy link

Hello, i am Dprof-in-tech, an experienced Full Stack Blockchain Developer and I am excited to contribute my skills to this project in this ODHACK 8. With a strong background in Next.js, TypeScript, JavaScript, React, Node.js, Rust and Cairo, I've honed my technical skills across the blockchain development landscape.

My journey with OnlyDust began at Edition 2, and I've since made 34 contributions across 11 projects. This extensive experience on the platform has allowed me to develop a keen understanding of delivering high-quality solutions under tight deadlines.
Due to my web2 experience, i am skilled in writing unit tests and have used Jest and Vitest to do this. I would love to contribute to this project by solving this issue.

Below is a link to my OnlyDust public profile.
https://app.onlydust.com/u/Dprof-in-tech

i would love to work on writing the integration tests for this issue using Vitest. my expected time of delivery would be in 3-4 days after being assigned.

@sonimwangi
Copy link

Mind if I take this issue?

@sigmadawg
Copy link

im a newbie contributor, i'd be grateful if you'd give me the opportunity to work in this.

@Jemiiah
Copy link

Jemiiah commented Oct 30, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello @ElliotFriend I'm a frontend web 3 developer I have good experience in tackling OD Hack issue and this is my first time on this repository I have read the issue and understood what needs to be, hope to get assigned here is my GitHub profile : https://github.com/Jemiiah as well as my onlydust profile : https://app.onlydust.com/u/Jemiiah

How I plan on tackling this issue

First things first, gotta set up Vitest. It's pretty straightforward:

Now, I'll go through /src/lib/stellar/* and /src/lib/utils.js, make a list of all the exported functions, and decide which ones are the most important or complex. Those are the ones I'll tackle first.

For each file, I'll make a matching test file right next to it. So like, utils.js gets a utils.test.js buddy.

Writing the actual tests is where the fun begins:

Start simple: just check if the function exists Test the normal inputs and outputs Throw some weird stuff at it (empty inputs, huge numbers, etc.) Make sure it doesn't fall apart when something goes wrong If a function is calling APIs or doing something I can't easily test, I'll mock that stuff out. No need to actually hit external services for unit tests.

I want to know how much of my code I'm actually testing, so I'll set up coverage:

I'll start with the easy functions and work my way up to the trickier ones. Utilities are super important, so I'll make sure those are rock solid.

To keep things organized, I'll use describe blocks. Group tests for each function, and if a function has different scenarios, I'll nest describe blocks.

Once I've got a decent set of tests, I'll set up GitHub Actions to run them on every commit. No broken code sneaking into main!

Last but not least, I've gotta keep these tests up to date. When I change a function, I update its tests. New function? New tests. And every now and then, I'll go through and clean up the tests to keep them running smooth.

@ElliotFriend OD Hack ends soon pls kindly assign this issue

@Michaelkingsdev
Copy link

May I handle this issue?

@Kaminar-i
Copy link

Please is this issue still available, I'm still waiting, thank you.

@pheobeayo
Copy link

Can I tackle this one?

@SoarinSkySagar
Copy link
Contributor

May I take care of this? I've got experience with this repository and I can make this issue close within 2 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ODHack9 Issues eligible for the OnlyDust hackathon
Projects
None yet
Development

No branches or pull requests