lane711 / sonicjs

SonicJs Headless CMS - Blazing Fast Headless CMS built on Cloudflare Workers. 100% Javascript Based
https://sonicjs.com
795 stars 110 forks source link

Add unit tests to cover lucia (authentication - login/registration/tokens/access controls/etc) #235

Open lane711 opened 4 months ago

lane711 commented 4 months ago

Thanks to @acoreyj , we now have a full implementation of Lucia js (https://lucia.js.org/)

We need to add unit/integration tests to cover this new functionality.

I did start on a simple auth test here: src/cms/admin/auth.test.ts

This should cover:

  1. Initial admin user registration
  2. login/logout
  3. authentication tokens
  4. access controls
  5. etc

See here for more info: https://sonicjs.com/authentication

There are also some tests that broke as a result of these changes that need to be fixed.

totto2727 commented 4 months ago

Currently, most tests fail and cause a lot of type problems. Could this be the cause of the broken tests? If this is the cause of my environment, I would be glad to know what settings I need to set up to get the tests to pass.

I am still trying to figure out this project. So, I was planning to make tentative (comment out or any type) responses to the problem areas and submit a PR with the tests and type checks passing.

I also found in our research that there is a problem with the D1-related tests. Is it possible to implement the tests in the current project structure? If possible, we would like to address this issue gradually.

https://github.com/totto2727-org/lapriere-cms/pull/2