RealDevSquad / RealDevSquad/website-backend

Updating addUser util with more functionality

Open
#371 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question tests
Dominant language
JavaScript
Stars
74
Forks
276
Avg merge
1d 26m
Merged PRs (30d)
14

Description

/test/utils/addUser.js

  1. Currently only returns a new user created using the index 0 of the /test/fixtures/user/user.js

In cases where we need multiple users, if we call the addUser() multiple times, we will not add a new user and instead update it.
This might be an issue for tests where we need to use multiple users.

  1. In cases we where need to create a super_user (authorized user) we do not have any functionality for the same as well

Currently, we are achieving this by importing the fixtures and picking the required user index from them and passing that as an argument to addUser()

Suggestion: We can create another util function in the addUser.js called addSuperUser() to solve issue 2 mentioned above.
As for issue 1, we will need to decide do we need a new solution or do we stick with the current method

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with /test/utils/addUser.js and the user fixtures at /test/fixtures/user/user.js. Check how repeated addUser() calls select and persist users, and how tests currently create super users. Done means the utility supports distinct users for repeated calls and provides the proposed super-user functionality, with the chosen behavior documented by the relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend, testing-qa
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.