Skip to content

Commit

Permalink
refactor: update ci and package (#6167)
Browse files Browse the repository at this point in the history
* refactor: update ci and package

* chore: fix tests
  • Loading branch information
gao-sun authored Jul 3, 2024
1 parent afd2d22 commit c7010bb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ jobs:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
GH_DEBUG: api
run: gh workflow run rerun.yml -F run_id=${{ github.run_id }}
run: gh workflow run rerun.yml -r ${{ github.head_ref || github.ref_name }} -F run_id=${{ github.run_id }}
2 changes: 2 additions & 0 deletions .github/workflows/rerun.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# From this genius: https://github.com/orgs/community/discussions/67654#discussioncomment-8038649
name: Rerun workflow

on:
workflow_dispatch:
inputs:
Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@logto/connector-kit": "workspace:^3.0.0",
"@logto/core-kit": "workspace:^",
"@logto/js": "^4.1.4",
"@logto/node": "^2.4.7",
"@logto/node": "^2.5.4",
"@logto/schemas": "workspace:^1.17.0",
"@logto/shared": "workspace:^3.1.1",
"@silverhand/eslint-config": "6.0.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'node:assert';

import { UserScope, buildOrganizationUrn } from '@logto/core-kit';
import { LogtoError } from '@logto/js';
import { LogtoRequestError } from '@logto/js';
import { InteractionEvent, MfaFactor } from '@logto/schemas';

import { createUserMfaVerification, deleteUser } from '#src/api/admin-user.js';
Expand Down Expand Up @@ -100,12 +100,8 @@ describe('get access token for organization', () => {
.getOrganizationTokenClaims(newOrganization.id)
.catch((error: unknown) => error);

assert(error instanceof LogtoError);
expect(error.code).toBe('unexpected_response_error');
expect(error.data).toMatchObject({
code: 'oidc.access_denied',
error: 'access_denied',
});
assert(error instanceof LogtoRequestError);
expect(error.code).toBe('oidc.access_denied');
});

it('should throw when organization requires mfa but user has not configured', async () => {
Expand All @@ -116,12 +112,8 @@ describe('get access token for organization', () => {
.getOrganizationTokenClaims(testOrganizationId)
.catch((error: unknown) => error);

assert(error instanceof LogtoError);
expect(error.code).toBe('unexpected_response_error');
expect(error.data).toMatchObject({
code: 'oidc.access_denied',
error: 'access_denied',
});
assert(error instanceof LogtoRequestError);
expect(error.code).toBe('oidc.access_denied');
});

it('should be able to get access token for organization when user has mfa configured', async () => {
Expand Down
22 changes: 6 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c7010bb

Please sign in to comment.