gitbeaker/test/tests/services/ApplicationSettings.ts
Pavel Birukov f2da029b15 Fix unreliable ApplicationSettings test
it tests internals of Gitlab instead of funtionality, and fails on new versions of Gitlab, if they change the list of available settings
2018-10-30 12:16:10 +01:00

25 lines
738 B
TypeScript

import { ApplicationSettings } from '../../../src';
describe('ApplicationSettings.all', () => {
let settings: ReturnType<ApplicationSettings['all']>;
beforeEach(async () => {
const service = new ApplicationSettings({
url: process.env.GITLAB_URL,
token: process.env.PERSONAL_ACCESS_TOKEN,
});
settings = await service.all();
});
it('should return an array', async () => {
expect(settings).toBeObject();
});
/**
* @see https://docs.gitlab.com/ee/api/settings.html#get-current-application-settings
*/
it('should contain all the required properties', async () => {
expect(Object.keys(settings)).toContain('id');
expect(Object.keys(settings)).toContain('gravatar_enabled');
});
});