Skip to content

Commit

Permalink
Generator: add missing test
Browse files Browse the repository at this point in the history
  • Loading branch information
qmonmert committed Nov 10, 2024
1 parent 61119bf commit d6f2ae8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { ManagementInfo } from '@/module/domain/ManagementInfo';
import { RestManagementRepository } from '@/module/secondary/RestManagementRepository';
import { describe, expect, it } from 'vitest';
import { dataBackendResponse, stubAxiosHttp } from '../../http/AxiosHttpStub';

describe('Rest management repository', () => {
it('should get info using axios', async () => {
const axiosInstance = stubAxiosHttp();
const repository = new RestManagementRepository(axiosInstance);
axiosInstance.get.resolves(dataBackendResponse(restManagementInfo()));

const managementInfo = await repository.getInfo();

expect(managementInfo).toEqual(info);
});
});

const info = {
git: {
commit: {
id: {
describe: 'feat(rest): add management info',
abbrev: 'b3f4',
},
},
branch: 'main',
build: {
version: '1.2.3',
time: '19:00',
},
},
};

const restManagementInfo = (): ManagementInfo => info;
1 change: 0 additions & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export default defineConfig({
'src/main/webapp/app/main.ts',
'src/main/webapp/app/router/index.ts',
'src/main/webapp/app/**/application/*Provider.ts',
'src/main/webapp/app/module/secondary/RestManagementRepository.ts',
'src/main/webapp/app/injections.ts',
'**/*.d.ts',
'src/test/**/*',
Expand Down

0 comments on commit d6f2ae8

Please sign in to comment.