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

Implement Admin Request Management #347

Merged
merged 11 commits into from
Feb 22, 2025
Merged

Conversation

josephshenq
Copy link
Contributor

PR Title

Issue Number(s): #343 .

Critical Changes

  • New field VerifiedByAdmin added to user schema. (Only existed for the new users after made the change, but i think old users missing this field should be fine)
  • Change logic in the auth: when new user first time signed in, creates a user with verifiedByAdmin = false.
  • Add endpoints to find all unverified users, approve/decline requests.
  • Implement frontend components for request management page.
  • Implement sending emails to admin when there's new user signed up.

Testing

Tested the new workflow of users sign in using new accounts, admin got the email, admin go to request management page to approve/decline.

Tested approve with different roles, deleting existing accounts, etc.

Copy link

github-actions bot commented Feb 17, 2025

Coverage report for web

Caution

Test run failed

St.
Category Percentage Covered / Total
🔴 Statements 19.12% 265/1386
🔴 Branches 11.43% 48/420
🔴 Functions 7.79% 31/398
🔴 Lines 12.54% 148/1180

Test suite run failed

Failed tests: 0/23. Failed suites: 8/11.
  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
      at node_modules/@jest/core/build/TestScheduler.js:254:19
      at node_modules/emittery/index.js:363:13
          at Array.map (<anonymous>)
      at Emittery.emit (node_modules/emittery/index.js:361:23)


  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
      at node_modules/@jest/core/build/TestScheduler.js:254:19
      at node_modules/emittery/index.js:363:13
          at Array.map (<anonymous>)
      at Emittery.emit (node_modules/emittery/index.js:361:23)


  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
      at node_modules/@jest/core/build/TestScheduler.js:254:19
      at node_modules/emittery/index.js:363:13
          at Array.map (<anonymous>)
      at Emittery.emit (node_modules/emittery/index.js:361:23)


  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
      at node_modules/@jest/core/build/TestScheduler.js:254:19
      at node_modules/emittery/index.js:363:13
          at Array.map (<anonymous>)
      at Emittery.emit (node_modules/emittery/index.js:361:23)


  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
      at node_modules/@jest/core/build/TestScheduler.js:254:19
      at node_modules/emittery/index.js:363:13
          at Array.map (<anonymous>)
      at Emittery.emit (node_modules/emittery/index.js:361:23)


  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
      at node_modules/@jest/core/build/TestScheduler.js:254:19
      at node_modules/emittery/index.js:363:13
          at Array.map (<anonymous>)
      at Emittery.emit (node_modules/emittery/index.js:361:23)


  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/@jest/core/build/TestScheduler.js:133:18)
      at node_modules/@jest/core/build/TestScheduler.js:254:19
      at node_modules/emittery/index.js:363:13
          at Array.map (<anonymous>)
      at Emittery.emit (node_modules/emittery/index.js:361:23)


  ● Test suite failed to run

    Returning a Promise from "describe" is not supported. Tests must be defined synchronously.

      17 |  * @group unit
      18 |  */
    > 19 | describe("[API] Account - Integration Test", async () => {
         | ^
      20 |   const context = await createContextInner();
      21 |   const caller = appRouter.createCaller(context);
      22 |

      at Object.describe (__tests__/pages/api/account/account.int.test.ts:19:1)

Report generated by 🧪jest coverage report action from bfe4478

@SamratSahoo SamratSahoo merged commit b8cc453 into staging Feb 22, 2025
1 check failed
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.

2 participants