0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

refactor: fix test and ci

This commit is contained in:
Gao Sun 2024-03-21 23:10:24 +08:00
parent abffb9f95e
commit 3cb9b892da
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
3 changed files with 7 additions and 5 deletions

View file

@ -24,7 +24,8 @@ jobs:
uses: silverhand-io/actions-node-pnpm-run-steps@v4
- name: Commitlint
run: npx commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD
# Credit to https://stackoverflow.com/a/67365254/12514940
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
- name: Commitlint on PR title
run: echo '${{ github.event.pull_request.title }}' | npx commitlint

View file

@ -178,9 +178,10 @@ describe('admin console user management', () => {
});
it('should update user password successfully', async () => {
const user = await createUserByAdmin();
const userEntity = await updateUserPassword(user.id, 'new_password');
expect(userEntity).toMatchObject(user);
const { updatedAt, ...rest } = await createUserByAdmin();
const userEntity = await updateUserPassword(rest.id, 'new_password');
expect(userEntity).toMatchObject(rest);
expect(userEntity.updatedAt).toBeGreaterThan(updatedAt);
});
it('should link social identity successfully', async () => {

View file

@ -14,7 +14,7 @@ $$ begin
return new;
end; $$ language plpgsql;
/** A function to set the created_at column to the current time. */
/** A function to set the `updated_at` column to the current time. */
create function set_updated_at() returns trigger as
$$ begin
new.updated_at = now();