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

feat: added the Jest dependency for unit testing and a test for the admin page #145

Closed
wants to merge 13 commits into from
Closed

Conversation

Josue-SR
Copy link
Contributor

Checklist:

Description:

  • This PR has a new feature that can help with unit testing. It implements the Jest library, which is a really popular testing library for React, and has other dependencies for Jest.
  • I added a folder called test that contains all the the test files. In the test folder I have a file called admin.test.js that test to see if the admin page is secured. The test folder can be used for testing files in the future.
  • The admin.test.js consist of one test that passes mock data to a function that verifies if the user is an admin. If the test passes then it means the user was an admin and can access the admin page.
  • Run all test: npm test

Resources:

Closes #128

@Josue-SR Josue-SR requested a review from a team as a code owner October 15, 2022 04:46
@gitpod-io
Copy link

gitpod-io bot commented Oct 15, 2022

@socket-security
Copy link

socket-security bot commented Nov 6, 2022

Socket Security Pull Request Report

Dependency issues detected. If you merge this pull request, you will not be alerted to the instances of these issues again.

😵‍💫 Bin script confusion

This package has multiple bin scripts with the same name. This can cause non-deterministic behavior when installing or could be a sign of a supply chain attack

Consider removing one of the conflicting packages. Packages should only export bin scripts with their name

Package Bin script Source
[email protected] (added) jest package.json
[email protected] (added) jest package.json via [email protected]
Pull request report summary
Issue Status
Install scripts ✅ 0 issues
Native code ✅ 0 issues
Bin script confusion ⚠️ 2 issues
Bin script shell injection ✅ 0 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues
Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore [email protected] [email protected]

Powered by socket.dev

@utsab utsab closed this Dec 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Write unit tests to confirm that the admin dashboard page is secure
2 participants