-
Notifications
You must be signed in to change notification settings - Fork 8.2k
/
updates.ts
66 lines (54 loc) · 2.5 KB
/
updates.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import expect from '@kbn/expect';
import { FtrProviderContext } from '../services';
import { createScenario } from '../scenario';
import '../../../../test/plugin_functional/plugins/core_provider_plugin/types';
// eslint-disable-next-line import/no-default-export
export default function(ftrContext: FtrProviderContext) {
const { getService } = ftrContext;
const supertest = getService('supertest');
const testSubjects = getService('testSubjects');
const scenario = createScenario(ftrContext);
describe('changes in license types', () => {
after(async () => {
await scenario.teardown();
});
it('provides changes in license types', async () => {
await scenario.setup();
await scenario.waitForPluginToDetectLicenseUpdate();
const {
body: legacyInitialLicense,
header: legacyInitialLicenseHeaders,
} = await supertest.get('/api/xpack/v1/info').expect(200);
expect(legacyInitialLicense.license?.type).to.be('basic');
expect(legacyInitialLicense.features).to.have.property('security');
expect(legacyInitialLicenseHeaders['kbn-xpack-sig']).to.be.a('string');
await scenario.startTrial();
await scenario.waitForPluginToDetectLicenseUpdate();
const { body: legacyTrialLicense, header: legacyTrialLicenseHeaders } = await supertest
.get('/api/xpack/v1/info')
.expect(200);
expect(legacyTrialLicense.license?.type).to.be('trial');
expect(legacyTrialLicense.features).to.have.property('security');
expect(legacyTrialLicenseHeaders['kbn-xpack-sig']).to.not.be(
legacyInitialLicenseHeaders['kbn-xpack-sig']
);
await scenario.startBasic();
await scenario.waitForPluginToDetectLicenseUpdate();
const { body: legacyBasicLicense, header: legacyBasicLicenseHeaders } = await supertest
.get('/api/xpack/v1/info')
.expect(200);
expect(legacyBasicLicense.license?.type).to.be('basic');
expect(legacyBasicLicense.features).to.have.property('security');
expect(legacyBasicLicenseHeaders['kbn-xpack-sig']).to.not.be(
legacyInitialLicenseHeaders['kbn-xpack-sig']
);
// banner shown only when license expired not just deleted
await testSubjects.missingOrFail('licenseExpiredBanner');
});
});
}