Skip to content

Commit

Permalink
test: fix master image http test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
tada5hi committed Jul 17, 2024
1 parent 24043d3 commit c05f800
Showing 1 changed file with 1 addition and 37 deletions.
38 changes: 1 addition & 37 deletions packages/server-core/test/unit/http/master-image.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* view the LICENSE file that was distributed with this source code.
*/

import type { MasterImage, MasterImageGroup } from '@privateaim/core-kit';
import { MasterImageCommand } from '@privateaim/core-kit';
import { createTestSuite } from '../../utils';

describe('src/controllers/core/master-image', () => {
Expand All @@ -20,44 +18,10 @@ describe('src/controllers/core/master-image', () => {
await suite.down();
});

let masterImage : MasterImage;
let masterImageGroup : MasterImageGroup;

it('sync with git repository', async () => {
const client = suite.client();
const response = await client.masterImage.runCommand(MasterImageCommand.SYNC);

expect(response.groups).toBeDefined();
expect(response.images).toBeDefined();
});

it('should read collection', async () => {
const client = suite.client();

const { data } = await client.masterImage.getMany();
expect(data.length).toBeGreaterThan(0);

[masterImage] = data;
});

it('should read group collection', async () => {
const client = suite.client();

const { data } = await client.masterImageGroup.getMany();
expect(data.length).toBeGreaterThan(0);

[masterImageGroup] = data;
});

it('should delete resource', async () => {
const client = suite.client();

await client.masterImage.delete(masterImage.id);
});

it('should delete group resource', async () => {
const client = suite.client();

await client.masterImageGroup.delete(masterImageGroup.id);
expect(data.length).toBeGreaterThanOrEqual(0);
});
});

0 comments on commit c05f800

Please sign in to comment.