diff --git a/tests/unit/mockData/alert/ruleDataDiscordOpt.js b/tests/unit/mockData/alert/ruleDataDiscordOpt.js index 63b1636..4667313 100644 --- a/tests/unit/mockData/alert/ruleDataDiscordOpt.js +++ b/tests/unit/mockData/alert/ruleDataDiscordOpt.js @@ -6,7 +6,7 @@ alert_subject_args: [] alert_text: this is a test body alert_text_args: [] alert_text_type: alert_text_only -discord_emoji_title: ':error:' +discord_emoji_title: ':postal_horn:' discord_embed_footer: footer discord_embed_icon_url: http://testserver/xxx/test.png discord_proxy: https://hostname:8080/ diff --git a/tests/unit/specs/ConfigCondition.spec.js b/tests/unit/specs/ConfigCondition.spec.js index 79ae6c9..b4772d6 100644 --- a/tests/unit/specs/ConfigCondition.spec.js +++ b/tests/unit/specs/ConfigCondition.spec.js @@ -27,9 +27,10 @@ async function prep() { let wrapper; -describe('ConfigCondition log', () => { +describe('ConfigCondition log', async () => { + wrapper = await prep(); + it('renders the numEvents', async () => { - wrapper = await prep(); return expect(wrapper.text()).to.contain('ABOVE 10000'); }); diff --git a/tests/unit/specs/ConfigYamlScanEntireTimefame.spec.js b/tests/unit/specs/ConfigYamlScanEntireTimefame.spec.js index 9a70163..f424885 100644 --- a/tests/unit/specs/ConfigYamlScanEntireTimefame.spec.js +++ b/tests/unit/specs/ConfigYamlScanEntireTimefame.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../setup'; import { ruleYaml } from '../mockData/ruleDataScanEntireTimefame.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('ScanEntireTimefame YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, ruleYaml); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/QueriesLog.spec.js b/tests/unit/specs/QueriesLog.spec.js index cc84220..6d9b7c9 100644 --- a/tests/unit/specs/QueriesLog.spec.js +++ b/tests/unit/specs/QueriesLog.spec.js @@ -3,10 +3,9 @@ import Queries from '@/views/Queries'; import mockQueryLog from '../mockData/queryLog.json'; import { mountComponent, mockAxios } from '../setup'; -mockAxios.onGet('/api/metadata/elastalert_status').reply(200, mockQueryLog); - describe('Queries log', () => { it('renders the query log correctly', (done) => { + mockAxios.onGet('/api/metadata/elastalert_status').reply(200, mockQueryLog); let wrapper = mountComponent(Queries); wrapper.setData({ diff --git a/tests/unit/specs/alert/ConfigYamlAlerta.spec.js b/tests/unit/specs/alert/ConfigYamlAlerta.spec.js index 2ea2ab6..63a56e4 100644 --- a/tests/unit/specs/alert/ConfigYamlAlerta.spec.js +++ b/tests/unit/specs/alert/ConfigYamlAlerta.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataAlerta.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Alerta YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlAlerta002.spec.js b/tests/unit/specs/alert/ConfigYamlAlerta002.spec.js index 26fcd50..70d1470 100644 --- a/tests/unit/specs/alert/ConfigYamlAlerta002.spec.js +++ b/tests/unit/specs/alert/ConfigYamlAlerta002.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataAlerta002.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Alerta 002 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlAlertaOpt.spec.js b/tests/unit/specs/alert/ConfigYamlAlertaOpt.spec.js index 00f1cc3..d76dd39 100644 --- a/tests/unit/specs/alert/ConfigYamlAlertaOpt.spec.js +++ b/tests/unit/specs/alert/ConfigYamlAlertaOpt.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataAlertaOpt.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('AlertaOpt YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlAlertmanager.spec.js b/tests/unit/specs/alert/ConfigYamlAlertmanager.spec.js index 0ea6762..9a3e224 100644 --- a/tests/unit/specs/alert/ConfigYamlAlertmanager.spec.js +++ b/tests/unit/specs/alert/ConfigYamlAlertmanager.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataAlertmanager.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Alertmanager YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlAlertmanager002.spec.js b/tests/unit/specs/alert/ConfigYamlAlertmanager002.spec.js index 189ab0f..73f5e15 100644 --- a/tests/unit/specs/alert/ConfigYamlAlertmanager002.spec.js +++ b/tests/unit/specs/alert/ConfigYamlAlertmanager002.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataAlertmanager002.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - -describe('Alertmanager YAML parsing', () => { +describe('Alertmanager 002 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlChatwork.spec.js b/tests/unit/specs/alert/ConfigYamlChatwork.spec.js index e65d345..ce4d648 100644 --- a/tests/unit/specs/alert/ConfigYamlChatwork.spec.js +++ b/tests/unit/specs/alert/ConfigYamlChatwork.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataChatwork.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Chatwork YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlCommand.spec.js b/tests/unit/specs/alert/ConfigYamlCommand.spec.js index 94d865d..f909d3a 100644 --- a/tests/unit/specs/alert/ConfigYamlCommand.spec.js +++ b/tests/unit/specs/alert/ConfigYamlCommand.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataCommand.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Command YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlDataDatadog.spec.js b/tests/unit/specs/alert/ConfigYamlDataDatadog.spec.js index 9ae4143..a51329d 100644 --- a/tests/unit/specs/alert/ConfigYamlDataDatadog.spec.js +++ b/tests/unit/specs/alert/ConfigYamlDataDatadog.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataDatadog.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Datadog YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlDingtalk.spec.js b/tests/unit/specs/alert/ConfigYamlDingtalk.spec.js index a91a4ba..373960b 100644 --- a/tests/unit/specs/alert/ConfigYamlDingtalk.spec.js +++ b/tests/unit/specs/alert/ConfigYamlDingtalk.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataDingtalk.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - -describe('Alerta YAML parsing', () => { +describe('Dingtalk YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlDingtalk002.spec.js b/tests/unit/specs/alert/ConfigYamlDingtalk002.spec.js index 9b4987c..3164cae 100644 --- a/tests/unit/specs/alert/ConfigYamlDingtalk002.spec.js +++ b/tests/unit/specs/alert/ConfigYamlDingtalk002.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataDingtalk002.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - -describe('Alerta YAML parsing', () => { +describe('Dingtalk 002 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlDingtalk003.spec.js b/tests/unit/specs/alert/ConfigYamlDingtalk003.spec.js index 882993c..71e7fd0 100644 --- a/tests/unit/specs/alert/ConfigYamlDingtalk003.spec.js +++ b/tests/unit/specs/alert/ConfigYamlDingtalk003.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataDingtalk003.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - -describe('Alerta YAML parsing', () => { +describe('Dingtalk 003 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlDingtalk004.spec.js b/tests/unit/specs/alert/ConfigYamlDingtalk004.spec.js index 3040733..223a78e 100644 --- a/tests/unit/specs/alert/ConfigYamlDingtalk004.spec.js +++ b/tests/unit/specs/alert/ConfigYamlDingtalk004.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataDingtalk004.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - -describe('Alerta YAML parsing', () => { +describe('Dingtalk 003 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlDiscord.spec.js b/tests/unit/specs/alert/ConfigYamlDiscord.spec.js index 7f03ebe..c3b3bda 100644 --- a/tests/unit/specs/alert/ConfigYamlDiscord.spec.js +++ b/tests/unit/specs/alert/ConfigYamlDiscord.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataDiscord.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Discord YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlDiscordOpt.spec.js b/tests/unit/specs/alert/ConfigYamlDiscordOpt.spec.js index 774ecd3..4177536 100644 --- a/tests/unit/specs/alert/ConfigYamlDiscordOpt.spec.js +++ b/tests/unit/specs/alert/ConfigYamlDiscordOpt.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataDiscordOpt.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('DiscordOpt YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" @@ -20,7 +18,7 @@ alert_text: "this is a test body" alert_text_type: "alert_text_only" discord_embed_footer: "footer" discord_embed_icon_url: "http://testserver/xxx/test.png" -discord_emoji_title: ":error:" +discord_emoji_title: ":postal_horn:" discord_proxy: "https://hostname:8080/" discord_proxy_login: "user" discord_proxy_password: "password" diff --git a/tests/unit/specs/alert/ConfigYamlEmail.spec.js b/tests/unit/specs/alert/ConfigYamlEmail.spec.js index f2bf8a7..9bd83c0 100644 --- a/tests/unit/specs/alert/ConfigYamlEmail.spec.js +++ b/tests/unit/specs/alert/ConfigYamlEmail.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataEmail.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - -describe('Alerta YAML parsing', () => { +describe('Email YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlEmail002.spec.js b/tests/unit/specs/alert/ConfigYamlEmail002.spec.js index 91b59f7..6846b35 100644 --- a/tests/unit/specs/alert/ConfigYamlEmail002.spec.js +++ b/tests/unit/specs/alert/ConfigYamlEmail002.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataEmail002.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - -describe('Alerta YAML parsing', () => { +describe('Email 002 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlExotel.spec.js b/tests/unit/specs/alert/ConfigYamlExotel.spec.js index 3575f6f..ed37c72 100644 --- a/tests/unit/specs/alert/ConfigYamlExotel.spec.js +++ b/tests/unit/specs/alert/ConfigYamlExotel.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataExotel.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Exotel YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlGelf001.spec.js b/tests/unit/specs/alert/ConfigYamlGelf001.spec.js index 107ffe4..55aab75 100644 --- a/tests/unit/specs/alert/ConfigYamlGelf001.spec.js +++ b/tests/unit/specs/alert/ConfigYamlGelf001.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataGelf001.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - -describe('Gelf 001 YAML parsing', () => { +describe('Gelf 001 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlGelf002.spec.js b/tests/unit/specs/alert/ConfigYamlGelf002.spec.js index d105ea0..22677df 100644 --- a/tests/unit/specs/alert/ConfigYamlGelf002.spec.js +++ b/tests/unit/specs/alert/ConfigYamlGelf002.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataGelf002.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - -describe('Gelf 002 YAML parsing', () => { +describe('Gelf 002 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlGitter.spec.js b/tests/unit/specs/alert/ConfigYamlGitter.spec.js index 7ab6a1d..090afcf 100644 --- a/tests/unit/specs/alert/ConfigYamlGitter.spec.js +++ b/tests/unit/specs/alert/ConfigYamlGitter.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataGitter.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Gitter YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlGitterOpt.spec.js b/tests/unit/specs/alert/ConfigYamlGitterOpt.spec.js index ce0e2e7..6bdfda2 100644 --- a/tests/unit/specs/alert/ConfigYamlGitterOpt.spec.js +++ b/tests/unit/specs/alert/ConfigYamlGitterOpt.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataGitterOpt.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('GitterOpt YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlGoogleChat.spec.js b/tests/unit/specs/alert/ConfigYamlGoogleChat.spec.js index 3ad8ac1..9e2cba9 100644 --- a/tests/unit/specs/alert/ConfigYamlGoogleChat.spec.js +++ b/tests/unit/specs/alert/ConfigYamlGoogleChat.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataGoogleChat.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('GoogleChat YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlGoogleChat002.spec.js b/tests/unit/specs/alert/ConfigYamlGoogleChat002.spec.js index a8dc0a4..2d860c4 100644 --- a/tests/unit/specs/alert/ConfigYamlGoogleChat002.spec.js +++ b/tests/unit/specs/alert/ConfigYamlGoogleChat002.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataGoogleChat002.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - -describe('GoogleChat YAML parsing', () => { +describe('GoogleChat 002 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlHttpPost.spec.js b/tests/unit/specs/alert/ConfigYamlHttpPost.spec.js index 4e90b81..5c17722 100644 --- a/tests/unit/specs/alert/ConfigYamlHttpPost.spec.js +++ b/tests/unit/specs/alert/ConfigYamlHttpPost.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataHttpPost.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('HttpPost YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlHttpPost002.spec.js b/tests/unit/specs/alert/ConfigYamlHttpPost002.spec.js index 665f380..d75891e 100644 --- a/tests/unit/specs/alert/ConfigYamlHttpPost002.spec.js +++ b/tests/unit/specs/alert/ConfigYamlHttpPost002.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataHttpPost002.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - -describe('HttpPost YAML parsing', () => { +describe('HttpPost 002 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlHttpPost2.spec.js b/tests/unit/specs/alert/ConfigYamlHttpPost2.spec.js index d59ff30..6ab84ba 100644 --- a/tests/unit/specs/alert/ConfigYamlHttpPost2.spec.js +++ b/tests/unit/specs/alert/ConfigYamlHttpPost2.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataHttpPost2.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('HttpPost2 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlHttpPost2Opt.spec.js b/tests/unit/specs/alert/ConfigYamlHttpPost2Opt.spec.js index e8138b1..09a3cdf 100644 --- a/tests/unit/specs/alert/ConfigYamlHttpPost2Opt.spec.js +++ b/tests/unit/specs/alert/ConfigYamlHttpPost2Opt.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataHttpPost2Opt.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('HttpPost2Opt YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlHttpPostOpt.spec.js b/tests/unit/specs/alert/ConfigYamlHttpPostOpt.spec.js index 0f09ee5..e10d615 100644 --- a/tests/unit/specs/alert/ConfigYamlHttpPostOpt.spec.js +++ b/tests/unit/specs/alert/ConfigYamlHttpPostOpt.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataHttpPostOpt.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('HttpPostOpt YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" @@ -24,7 +22,8 @@ http_post_ca_certs: "/etc/certs/cert.pem" http_post_ignore_ssl_errors: true http_post_proxy: "host:8080" http_post_timeout: 10 -http_post_url: "http://localhost/webhook" +http_post_url: + - "http://localhost/webhook" import: "BaseRule.config" index: "hannibal-*" is_enabled: false diff --git a/tests/unit/specs/alert/ConfigYamlIris.spec.js b/tests/unit/specs/alert/ConfigYamlIris.spec.js index 13507a2..d4cb6db 100644 --- a/tests/unit/specs/alert/ConfigYamlIris.spec.js +++ b/tests/unit/specs/alert/ConfigYamlIris.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataIris.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Iris YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlIris002.spec.js b/tests/unit/specs/alert/ConfigYamlIris002.spec.js index 10733d7..167d10e 100644 --- a/tests/unit/specs/alert/ConfigYamlIris002.spec.js +++ b/tests/unit/specs/alert/ConfigYamlIris002.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup.js'; import { ruleYaml } from '../../mockData/alert/ruleDataIris002.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Iris 002 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlJira.spec.js b/tests/unit/specs/alert/ConfigYamlJira.spec.js index 3c5beca..9d6d619 100644 --- a/tests/unit/specs/alert/ConfigYamlJira.spec.js +++ b/tests/unit/specs/alert/ConfigYamlJira.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataJira.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Jira YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlLark.spec.js b/tests/unit/specs/alert/ConfigYamlLark.spec.js index 3d40f7a..3cd2e7c 100644 --- a/tests/unit/specs/alert/ConfigYamlLark.spec.js +++ b/tests/unit/specs/alert/ConfigYamlLark.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataLark.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Lark YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlLineNotify.spec.js b/tests/unit/specs/alert/ConfigYamlLineNotify.spec.js index 3f85247..71fa98c 100644 --- a/tests/unit/specs/alert/ConfigYamlLineNotify.spec.js +++ b/tests/unit/specs/alert/ConfigYamlLineNotify.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataLineNotify.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('LineNotify YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlMattermost.spec.js b/tests/unit/specs/alert/ConfigYamlMattermost.spec.js index e7a79e6..efd0241 100644 --- a/tests/unit/specs/alert/ConfigYamlMattermost.spec.js +++ b/tests/unit/specs/alert/ConfigYamlMattermost.spec.js @@ -3,12 +3,11 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataMattermost.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - +// TODO: Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. describe('Mattermost YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlMattermost002.spec.js b/tests/unit/specs/alert/ConfigYamlMattermost002.spec.js index 0da7fcf..8fc1fd5 100644 --- a/tests/unit/specs/alert/ConfigYamlMattermost002.spec.js +++ b/tests/unit/specs/alert/ConfigYamlMattermost002.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataMattermost002.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - -describe('Mattermost002 YAML parsing', () => { +describe('Mattermost 002 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" @@ -27,6 +25,10 @@ generate_kibana_discover_url: true import: "BaseRule.config" index: "hannibal-*" is_enabled: false +kibana_discover_from_timedelta: + minutes: 10 +kibana_discover_to_timedelta: + minutes: 10 match_enhancements: [] mattermost_attach_kibana_discover_url: true mattermost_author_icon: "author_icon" diff --git a/tests/unit/specs/alert/ConfigYamlMsTeams.spec.js b/tests/unit/specs/alert/ConfigYamlMsTeams.spec.js index 96b05a8..6e339a0 100644 --- a/tests/unit/specs/alert/ConfigYamlMsTeams.spec.js +++ b/tests/unit/specs/alert/ConfigYamlMsTeams.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataMsTeams.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('MsTeams YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlMsTeamsOpt.spec.js b/tests/unit/specs/alert/ConfigYamlMsTeamsOpt.spec.js index d8c0414..fe30223 100644 --- a/tests/unit/specs/alert/ConfigYamlMsTeamsOpt.spec.js +++ b/tests/unit/specs/alert/ConfigYamlMsTeamsOpt.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataMsTeamsOpt.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('MsTeamsOpt YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" @@ -27,6 +25,10 @@ generate_kibana_discover_url: true import: "BaseRule.config" index: "hannibal-*" is_enabled: false +kibana_discover_from_timedelta: + minutes: 10 +kibana_discover_to_timedelta: + minutes: 10 match_enhancements: [] ms_teams_alert_fixed_width: true ms_teams_alert_summary: "Message" diff --git a/tests/unit/specs/alert/ConfigYamlOpsgenie.spec.js b/tests/unit/specs/alert/ConfigYamlOpsgenie.spec.js index 847181b..0196d51 100644 --- a/tests/unit/specs/alert/ConfigYamlOpsgenie.spec.js +++ b/tests/unit/specs/alert/ConfigYamlOpsgenie.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataOpsgenie.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Opsgenie YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlOpsgenie002.spec.js b/tests/unit/specs/alert/ConfigYamlOpsgenie002.spec.js index cac9c8e..2b08667 100644 --- a/tests/unit/specs/alert/ConfigYamlOpsgenie002.spec.js +++ b/tests/unit/specs/alert/ConfigYamlOpsgenie002.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataOpsgenie002.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Opsgenie 002 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlOpsgenie003.spec.js b/tests/unit/specs/alert/ConfigYamlOpsgenie003.spec.js index 93e14ac..bcdd4ef 100644 --- a/tests/unit/specs/alert/ConfigYamlOpsgenie003.spec.js +++ b/tests/unit/specs/alert/ConfigYamlOpsgenie003.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataOpsgenie003.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Opsgenie 003 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlOpsgenie004.spec.js b/tests/unit/specs/alert/ConfigYamlOpsgenie004.spec.js index 6492ed3..301d280 100644 --- a/tests/unit/specs/alert/ConfigYamlOpsgenie004.spec.js +++ b/tests/unit/specs/alert/ConfigYamlOpsgenie004.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataOpsgenie004.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Opsgenie 004 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlOpsgenie005.spec.js b/tests/unit/specs/alert/ConfigYamlOpsgenie005.spec.js index 7c8b830..ef3c83f 100644 --- a/tests/unit/specs/alert/ConfigYamlOpsgenie005.spec.js +++ b/tests/unit/specs/alert/ConfigYamlOpsgenie005.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataOpsgenie005.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Opsgenie 005 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlOpsgenie006.spec.js b/tests/unit/specs/alert/ConfigYamlOpsgenie006.spec.js index 0c8eb44..8192b3c 100644 --- a/tests/unit/specs/alert/ConfigYamlOpsgenie006.spec.js +++ b/tests/unit/specs/alert/ConfigYamlOpsgenie006.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataOpsgenie006.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Opsgenie 006 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlPagerDuty.spec.js b/tests/unit/specs/alert/ConfigYamlPagerDuty.spec.js index 1f4a85a..81843e3 100644 --- a/tests/unit/specs/alert/ConfigYamlPagerDuty.spec.js +++ b/tests/unit/specs/alert/ConfigYamlPagerDuty.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataPagerDuty.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('PagerDuty YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlPagerDuty002.spec.js b/tests/unit/specs/alert/ConfigYamlPagerDuty002.spec.js index 3628566..b3b7441 100644 --- a/tests/unit/specs/alert/ConfigYamlPagerDuty002.spec.js +++ b/tests/unit/specs/alert/ConfigYamlPagerDuty002.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataPagerDuty002.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('PagerDuty 002 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlPagerDuty003.spec.js b/tests/unit/specs/alert/ConfigYamlPagerDuty003.spec.js index e1c4e7b..cf1b8d5 100644 --- a/tests/unit/specs/alert/ConfigYamlPagerDuty003.spec.js +++ b/tests/unit/specs/alert/ConfigYamlPagerDuty003.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataPagerDuty003.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('PagerDuty 003 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlPagerDuty004.spec.js b/tests/unit/specs/alert/ConfigYamlPagerDuty004.spec.js index 66eeef0..b0e9e2e 100644 --- a/tests/unit/specs/alert/ConfigYamlPagerDuty004.spec.js +++ b/tests/unit/specs/alert/ConfigYamlPagerDuty004.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataPagerDuty004.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('PagerDuty 004 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlPagerDuty005.spec.js b/tests/unit/specs/alert/ConfigYamlPagerDuty005.spec.js index ce5cfcc..fa34909 100644 --- a/tests/unit/specs/alert/ConfigYamlPagerDuty005.spec.js +++ b/tests/unit/specs/alert/ConfigYamlPagerDuty005.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataPagerDuty005.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('PagerDuty 005 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlPagerTree.spec.js b/tests/unit/specs/alert/ConfigYamlPagerTree.spec.js index 193ccca..c93a5b4 100644 --- a/tests/unit/specs/alert/ConfigYamlPagerTree.spec.js +++ b/tests/unit/specs/alert/ConfigYamlPagerTree.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataPagerTree.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('PagerTree YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlRocketChat.spec.js b/tests/unit/specs/alert/ConfigYamlRocketChat.spec.js index 233ec8d..f722bbc 100644 --- a/tests/unit/specs/alert/ConfigYamlRocketChat.spec.js +++ b/tests/unit/specs/alert/ConfigYamlRocketChat.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataRocketChat.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Rocket.Chat YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlRocketChat002.spec.js b/tests/unit/specs/alert/ConfigYamlRocketChat002.spec.js index dfe0078..6752fee 100644 --- a/tests/unit/specs/alert/ConfigYamlRocketChat002.spec.js +++ b/tests/unit/specs/alert/ConfigYamlRocketChat002.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataRocketChat002.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Rocket.Chat 002 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" @@ -27,6 +25,10 @@ generate_kibana_discover_url: true import: "BaseRule.config" index: "hannibal-*" is_enabled: false +kibana_discover_from_timedelta: + minutes: 10 +kibana_discover_to_timedelta: + minutes: 10 match_enhancements: [] name: "test123" num_events: 10000 diff --git a/tests/unit/specs/alert/ConfigYamlServiceNow.spec.js b/tests/unit/specs/alert/ConfigYamlServiceNow.spec.js index 4858350..d0a21f1 100644 --- a/tests/unit/specs/alert/ConfigYamlServiceNow.spec.js +++ b/tests/unit/specs/alert/ConfigYamlServiceNow.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataServiceNow.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('ServiceNow YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlSes.spec.js b/tests/unit/specs/alert/ConfigYamlSes.spec.js index dc28369..2aa663d 100644 --- a/tests/unit/specs/alert/ConfigYamlSes.spec.js +++ b/tests/unit/specs/alert/ConfigYamlSes.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataSes.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Ses YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlSesProfile.spec.js b/tests/unit/specs/alert/ConfigYamlSesProfile.spec.js index 4137c7b..e1c4f4e 100644 --- a/tests/unit/specs/alert/ConfigYamlSesProfile.spec.js +++ b/tests/unit/specs/alert/ConfigYamlSesProfile.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataSesProfile.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('SesProfile YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlSlack.spec.js b/tests/unit/specs/alert/ConfigYamlSlack.spec.js index 506313a..51d8baa 100644 --- a/tests/unit/specs/alert/ConfigYamlSlack.spec.js +++ b/tests/unit/specs/alert/ConfigYamlSlack.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataSlack.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Slack YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlSlack002.spec.js b/tests/unit/specs/alert/ConfigYamlSlack002.spec.js index 067162d..86111a6 100644 --- a/tests/unit/specs/alert/ConfigYamlSlack002.spec.js +++ b/tests/unit/specs/alert/ConfigYamlSlack002.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataSlack002.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Slack 002 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" @@ -27,6 +25,10 @@ generate_kibana_discover_url: true import: "BaseRule.config" index: "hannibal-*" is_enabled: false +kibana_discover_from_timedelta: + minutes: 10 +kibana_discover_to_timedelta: + minutes: 10 match_enhancements: [] name: "test123" num_events: 10000 diff --git a/tests/unit/specs/alert/ConfigYamlSns.spec.js b/tests/unit/specs/alert/ConfigYamlSns.spec.js index 83a9384..88be401 100644 --- a/tests/unit/specs/alert/ConfigYamlSns.spec.js +++ b/tests/unit/specs/alert/ConfigYamlSns.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataSns.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Sns YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlSnsProfile.spec.js b/tests/unit/specs/alert/ConfigYamlSnsProfile.spec.js index b56a8d6..ce6e960 100644 --- a/tests/unit/specs/alert/ConfigYamlSnsProfile.spec.js +++ b/tests/unit/specs/alert/ConfigYamlSnsProfile.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataSnsProfile.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('SnsProfile YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlStomp.spec.js b/tests/unit/specs/alert/ConfigYamlStomp.spec.js index 57bedcc..e6ddc02 100644 --- a/tests/unit/specs/alert/ConfigYamlStomp.spec.js +++ b/tests/unit/specs/alert/ConfigYamlStomp.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataStomp.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Stomp YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlStompModRequiredAndOpt.spec.js b/tests/unit/specs/alert/ConfigYamlStompModRequiredAndOpt.spec.js index f4d27e5..75fa681 100644 --- a/tests/unit/specs/alert/ConfigYamlStompModRequiredAndOpt.spec.js +++ b/tests/unit/specs/alert/ConfigYamlStompModRequiredAndOpt.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataStompModRequiredAndOpt.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('StompModRequiredAndOpt YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlTelegram001.spec.js b/tests/unit/specs/alert/ConfigYamlTelegram001.spec.js index a999ca7..8ef11a1 100644 --- a/tests/unit/specs/alert/ConfigYamlTelegram001.spec.js +++ b/tests/unit/specs/alert/ConfigYamlTelegram001.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataTelegram001.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - -describe('Telegram YAML parsing', () => { +describe('Telegram 001 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlTelegram002.spec.js b/tests/unit/specs/alert/ConfigYamlTelegram002.spec.js index ab356cd..ef18827 100644 --- a/tests/unit/specs/alert/ConfigYamlTelegram002.spec.js +++ b/tests/unit/specs/alert/ConfigYamlTelegram002.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataTelegram002.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - -describe('Telegram YAML parsing', () => { +describe('Telegram 002 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlTelegram003.spec.js b/tests/unit/specs/alert/ConfigYamlTelegram003.spec.js index f094fea..9374f43 100644 --- a/tests/unit/specs/alert/ConfigYamlTelegram003.spec.js +++ b/tests/unit/specs/alert/ConfigYamlTelegram003.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataTelegram003.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - -describe('Telegram YAML parsing', () => { +describe('Telegram 003 YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlTencentSms.spec.js b/tests/unit/specs/alert/ConfigYamlTencentSms.spec.js index be3d4b7..89fb589 100644 --- a/tests/unit/specs/alert/ConfigYamlTencentSms.spec.js +++ b/tests/unit/specs/alert/ConfigYamlTencentSms.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataTencentSms.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('TencentSms YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlTencentSmsOpt.spec.js b/tests/unit/specs/alert/ConfigYamlTencentSmsOpt.spec.js index 9cd05b8..9761826 100644 --- a/tests/unit/specs/alert/ConfigYamlTencentSmsOpt.spec.js +++ b/tests/unit/specs/alert/ConfigYamlTencentSmsOpt.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataTencentSmsOpt.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('TencentSmsOpt YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlTheHive.spec.js b/tests/unit/specs/alert/ConfigYamlTheHive.spec.js index 9186fb9..56b55cb 100644 --- a/tests/unit/specs/alert/ConfigYamlTheHive.spec.js +++ b/tests/unit/specs/alert/ConfigYamlTheHive.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataTheHive.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('TheHive YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlTheHiveOpt.spec.js b/tests/unit/specs/alert/ConfigYamlTheHiveOpt.spec.js index e8d87a9..f6ccc6a 100644 --- a/tests/unit/specs/alert/ConfigYamlTheHiveOpt.spec.js +++ b/tests/unit/specs/alert/ConfigYamlTheHiveOpt.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataTheHiveOpt.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('TheHiveOpt YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlTwilioCopilot.spec.js b/tests/unit/specs/alert/ConfigYamlTwilioCopilot.spec.js index 6f39909..a3f729a 100644 --- a/tests/unit/specs/alert/ConfigYamlTwilioCopilot.spec.js +++ b/tests/unit/specs/alert/ConfigYamlTwilioCopilot.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataTwilioCopilot.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('TwilioCopilot YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlTwilioSms.spec.js b/tests/unit/specs/alert/ConfigYamlTwilioSms.spec.js index 80192fe..28b29bf 100644 --- a/tests/unit/specs/alert/ConfigYamlTwilioSms.spec.js +++ b/tests/unit/specs/alert/ConfigYamlTwilioSms.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataTwilioSms.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('TwilioSms YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlVictorOps.spec.js b/tests/unit/specs/alert/ConfigYamlVictorOps.spec.js index 2cc36fa..70a024d 100644 --- a/tests/unit/specs/alert/ConfigYamlVictorOps.spec.js +++ b/tests/unit/specs/alert/ConfigYamlVictorOps.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataVictorOps.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('VictorOps YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlVictorOpsOpt.spec.js b/tests/unit/specs/alert/ConfigYamlVictorOpsOpt.spec.js index 663b852..f3c3167 100644 --- a/tests/unit/specs/alert/ConfigYamlVictorOpsOpt.spec.js +++ b/tests/unit/specs/alert/ConfigYamlVictorOpsOpt.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataVictorOpsOpt.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('VictorOpsOpt YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlZabbix.spec.js b/tests/unit/specs/alert/ConfigYamlZabbix.spec.js index 6ed55e5..07e5e80 100644 --- a/tests/unit/specs/alert/ConfigYamlZabbix.spec.js +++ b/tests/unit/specs/alert/ConfigYamlZabbix.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataZabbix.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('Zabbix YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/tests/unit/specs/alert/ConfigYamlZabbixSenderHostPort.spec.js b/tests/unit/specs/alert/ConfigYamlZabbixSenderHostPort.spec.js index 76a76a7..1a03eba 100644 --- a/tests/unit/specs/alert/ConfigYamlZabbixSenderHostPort.spec.js +++ b/tests/unit/specs/alert/ConfigYamlZabbixSenderHostPort.spec.js @@ -3,12 +3,10 @@ import store from '@/store'; import { mockAxios } from '../../setup'; import { ruleYaml } from '../../mockData/alert/ruleDataZabbixSenderHostPort.js'; -mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); - describe('YAML parsing', () => { it('renders the correct yaml', async () => { + mockAxios.onGet('/api/rules/test123').reply(200, { yaml: ruleYaml }); await store.dispatch('config/load', { type: 'rules', path: 'test123' }); - let yaml = store.getters['config/yaml'](); let expected = `__praeco_full_path: "test123" diff --git a/vue.config.js b/vue.config.js index 4f84b29..5b9500c 100644 --- a/vue.config.js +++ b/vue.config.js @@ -3,7 +3,7 @@ const webpack = require('webpack'); module.exports = { publicPath: process.env.VUE_APP_BASE_URL ? process.env.VUE_APP_BASE_URL : '/', configureWebpack: { - devtool: process.env.NODE_ENV === 'coverage' ? '#eval' : undefined, + devtool: process.env.NODE_ENV === 'coverage' ? 'eval' : undefined, performance: { hints: false },