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: created unit tests for the admin page using Jest #220

Closed
wants to merge 15 commits into from
Closed

feat: created unit tests for the admin page using Jest #220

wants to merge 15 commits into from

Conversation

Josue-SR
Copy link
Contributor

@Josue-SR Josue-SR commented Jan 8, 2023

Checklist:

Closes #128

Description:

  • This PR has a new feature that can help with unit testing. It implements the Jest library, a popular testing library for React, that helps with mocking functions.
  • I added a folder called test that contains all 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 tests: npm test)

@Josue-SR Josue-SR requested a review from a team as a code owner January 8, 2023 20:18
@socket-security
Copy link

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

@GuillermoFloresV
Copy link
Member

Hey Josue, can we try upgrading Jest to the latest version (29.3.1)? Maybe this is an issue with outdated dependencies.

@Josue-SR Josue-SR closed this by deleting the head repository Feb 12, 2023
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