Skip to content

Commit

Permalink
[EDR Workflows] Unskip Jest Protection Updates test (elastic#183396)
Browse files Browse the repository at this point in the history
Closes elastic#183348

Move date object creation to single test execution instead of defining
it beforehand. This way we minimize the probability of assertion being
run a day after the test was picked up by CI runner (11:59:59 pm vs
00:00:00 am).
  • Loading branch information
szwarckonrad authored May 14, 2024
1 parent 25a4311 commit 1a61313
Showing 1 changed file with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -562,17 +562,14 @@ describe('ingest_integration tests ', () => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/183348
describe.skip('when the license is at least enterprise', () => {
describe('when the license is at least enterprise', () => {
const soClient = savedObjectsClientMock.create();
const esClient = elasticsearchServiceMock.createClusterClient().asInternalUser;

beforeEach(() => {
licenseEmitter.next(Enterprise); // set license level to enterprise
});

const validDateYesterday = moment.utc().subtract(1, 'day');

it('should throw if endpointProtectionUpdates productFeature is disabled and user modifies global_manifest_version', async () => {
productFeaturesService = createProductFeaturesServiceMock(
ALL_PRODUCT_FEATURE_KEYS.filter((key) => key !== 'endpoint_protection_updates')
Expand Down Expand Up @@ -611,21 +608,23 @@ describe('ingest_integration tests ', () => {
},
{
date: '2100-10-01',
message: `Global manifest version cannot be in the future. Latest selectable date is ${validDateYesterday.format(
'MMMM DD, YYYY'
)} UTC time.`,
message: `Global manifest version cannot be in the future. Latest selectable date is ${moment
.utc()
.subtract(1, 'day')
.format('MMMM DD, YYYY')} UTC time.`,
},
{
date: validDateYesterday.clone().add(1, 'day').format('YYYY-MM-DD'),
message: `Global manifest version cannot be in the future. Latest selectable date is ${validDateYesterday.format(
'MMMM DD, YYYY'
)} UTC time.`,
date: moment.utc().format('YYYY-MM-DD'),
message: `Global manifest version cannot be in the future. Latest selectable date is ${moment
.utc()
.subtract(1, 'day')
.format('MMMM DD, YYYY')} UTC time.`,
},
{
date: 'latest',
},
{
date: validDateYesterday.format('YYYY-MM-DD'), // Correct date
date: moment.utc().subtract(1, 'day').format('YYYY-MM-DD'), // Correct date
},
])(
'should return bad request for invalid endpoint package policy global manifest values',
Expand Down

0 comments on commit 1a61313

Please sign in to comment.