Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Jul 22, 2023
1 parent a54dd07 commit 25a93f0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions x-pack/plugins/actions/server/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ describe('Actions Plugin', () => {
getConfig({
preconfigured: {
preconfiguredServerLog: {
actionTypeId: '.cases',
actionTypeId: 'test.system-action',
name: 'preconfigured-system-action',
config: {},
secrets: {},
Expand All @@ -593,8 +593,8 @@ describe('Actions Plugin', () => {
const pluginSetup = await plugin.setup(coreSetup as any, pluginsSetup);

pluginSetup.registerType({
id: '.cases',
name: 'Cases',
id: 'test.system-action',
name: 'Test',
minimumLicenseRequired: 'platinum',
supportedFeatureIds: ['alerting'],
validate: {
Expand All @@ -609,7 +609,7 @@ describe('Actions Plugin', () => {
await expect(async () =>
plugin.start(coreStart, pluginsStart)
).rejects.toThrowErrorMatchingInlineSnapshot(
`"Setting system action types in preconfigured connectors is not allowed"`
`"Setting system action types in preconfigured connectors are not allowed"`
);
});
});
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/actions/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -624,11 +624,11 @@ export class ActionsPlugin implements Plugin<PluginSetupContract, PluginStartCon
(connector) => connector.isPreconfigured
);

const systemActionAsPreconfiguredInConfig = preConfiguredConnectors.some((connector) =>
const isSystemActionAsPreconfiguredInConfig = preConfiguredConnectors.some((connector) =>
this.actionTypeRegistry!.isSystemActionType(connector.actionTypeId)
);

if (systemActionAsPreconfiguredInConfig) {
if (isSystemActionAsPreconfiguredInConfig) {
throw new Error('Setting system action types in preconfigured connectors are not allowed');
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ describe('actions telemetry', () => {
isDeprecated: false,
isSystemAction: true,
secrets: {},
config: {},
},
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,7 @@ describe('create()', () => {
id: '1',
type: 'alert',
attributes: {
executionStatus: getRuleExecutionStatusPending('2019-02-12T21:01:22.479Z'),
alertTypeId: '123',
schedule: { interval: '1m' },
params: {
Expand Down Expand Up @@ -1338,6 +1339,10 @@ describe('create()', () => {
],
"alertTypeId": "123",
"createdAt": 2019-02-12T21:01:22.479Z,
"executionStatus": Object {
"lastExecutionDate": 2019-02-12T21:01:22.000Z,
"status": "pending",
},
"id": "1",
"notifyWhen": null,
"params": Object {
Expand Down Expand Up @@ -1392,10 +1397,8 @@ describe('create()', () => {
enabled: true,
legacyId: null,
executionStatus: {
error: null,
lastExecutionDate: '2019-02-12T21:01:22.479Z',
status: 'pending',
warning: null,
},
monitoring: getDefaultMonitoring('2019-02-12T21:01:22.479Z'),
meta: { versionApiKeyLastmodified: kibanaVersion },
Expand Down

0 comments on commit 25a93f0

Please sign in to comment.