mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
35 lines
950 B
TypeScript
35 lines
950 B
TypeScript
import { RequestHelper } from '../../../src/infrastructure';
|
|
import { ApplicationSettings } from '../../../src';
|
|
|
|
jest.mock(
|
|
'../../../src/infrastructure/RequestHelper',
|
|
() => require('../../__mocks__/RequestHelper').default,
|
|
);
|
|
|
|
let service: ApplicationSettings;
|
|
|
|
beforeEach(() => {
|
|
service = new ApplicationSettings({
|
|
requesterFn: jest.fn(),
|
|
token: 'abcdefg',
|
|
});
|
|
});
|
|
|
|
describe('ApplicationSettings.show', () => {
|
|
it('should request GET /application/settings', async () => {
|
|
await service.show();
|
|
|
|
expect(RequestHelper.get()).toHaveBeenCalledWith(service, 'application/settings', undefined);
|
|
});
|
|
});
|
|
|
|
describe('ApplicationSettings.edit', () => {
|
|
it('should request PUT /application/settings with a terms property', async () => {
|
|
await service.edit({ terms: 'Testing terms' });
|
|
|
|
expect(RequestHelper.put()).toHaveBeenCalledWith(service, 'application/settings', {
|
|
terms: 'Testing terms',
|
|
});
|
|
});
|
|
});
|