Skip to content

Commit

Permalink
fix: fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
darcyYe committed Nov 20, 2024
1 parent d3366d3 commit f767449
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { ApplicationType } from '@logto/schemas';

import { createApplication, deleteApplication } from '#src/api/application.js';
import { createSamlApplication, deleteSamlApplication } from '#src/api/saml-application.js';
import { expectRejects } from '#src/helpers/index.js';
import { devFeatureTest } from '#src/utils.js';

const { it, describe } = devFeatureTest;

describe('SAML application', () => {
it('should create and delete a SAML application successfully', async () => {
Expand All @@ -21,4 +28,16 @@ describe('SAML application', () => {

await deleteSamlApplication(createdSamlApplication.id);
});

it('can not delete non-SAML applications with `DEL /saml-applications/:id` API', async () => {
const application = await createApplication('test-non-saml-app', ApplicationType.Traditional, {
isThirdParty: true,
});

await expectRejects(deleteSamlApplication(application.id), {
code: 'application.saml_application_only',
status: 400,
});
await deleteApplication(application.id);
});
});

0 comments on commit f767449

Please sign in to comment.