Skip to content

Commit

Permalink
#1334: add test for event and fixKeys
Browse files Browse the repository at this point in the history
  • Loading branch information
JoernBerkefeld committed May 23, 2024
1 parent f09203c commit 6c7dce2
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions test/type.event.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import * as chai from 'chai';
const assert = chai.assert;
// const expect = chai.expect;

import chaiFiles from 'chai-files';
// import cache from '../lib/util/cache.js';
import * as testUtils from './utils.js';
import handler from '../lib/index.js';
chai.use(chaiFiles);
// const file = chaiFiles.file;

describe('type: event', () => {
beforeEach(() => {
testUtils.mockSetup();
});

afterEach(() => {
testUtils.mockReset();
});

describe('Retrieve ================', () => {});

describe('Deploy ================', () => {
beforeEach(() => {
testUtils.mockSetup(true);
});
});

describe('FixKeys ================', () => {
beforeEach(() => {
testUtils.mockSetup(true);
});

it('Should exit fixKeys because event is not supported intentionally', async () => {
// WHEN
handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } });
const resultFixKeys = await handler.fixKeys('testInstance/testBU', ['event']);
// THEN
assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error');
// check which keys were fixed
assert.equal(
resultFixKeys['testInstance/testBU'],
undefined,
'expected to find no keys to be fixed'
);

// check number of API calls
assert.equal(
testUtils.getAPIHistoryLength(),
0,
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
);
return;
});
});

describe('Templating ================', () => {});

describe('Delete ================', () => {});

describe('CI/CD ================', () => {});
});

0 comments on commit 6c7dce2

Please sign in to comment.