|
1 | | -import { setConfig, getConfig } from "../config"; |
| 1 | +import { setConfig, getConfig } from '../config'; |
2 | 2 |
|
3 | | -describe("config", () => { |
4 | | - it("should get default config", () => { |
| 3 | +describe('config', () => { |
| 4 | + it('should get default config', () => { |
5 | 5 | const config = getConfig(); |
6 | 6 | expect(config).toMatchInlineSnapshot(` |
| 7 | + Object { |
| 8 | + "ADDON_ID": "adk", |
| 9 | + "EVENT_ID_BACK": "adk/event/back", |
| 10 | + "EVENT_ID_DATA": "adk/event/data", |
| 11 | + "EVENT_ID_INIT": "adk/event/init", |
| 12 | + "PANEL_ID": "adk/panel", |
| 13 | + "PANEL_Title": "adk/addon", |
| 14 | + "PARAM_Key": "adk/parameters", |
| 15 | + } |
| 16 | + `); |
| 17 | + }); |
| 18 | + |
| 19 | + it('should set config', () => { |
| 20 | + setConfig({ addonId: 'test' }); |
| 21 | + expect(getConfig()).toMatchInlineSnapshot(` |
| 22 | + Object { |
| 23 | + "ADDON_ID": "test", |
| 24 | + "EVENT_ID_BACK": "test/event/back", |
| 25 | + "EVENT_ID_DATA": "test/event/data", |
| 26 | + "EVENT_ID_INIT": "test/event/init", |
| 27 | + "PANEL_ID": "test/panel", |
| 28 | + "PANEL_Title": "test/addon", |
| 29 | + "PARAM_Key": "test/parameters", |
| 30 | + } |
| 31 | + `); |
| 32 | + |
| 33 | + setConfig({ panelTitle: 'ADK-TEST' }); |
| 34 | + expect(getConfig()).toMatchInlineSnapshot(` |
7 | 35 | Object { |
8 | | - "ADDON_ID": "adk", |
9 | | - "EVENT_ID_BACK": "adk/event/back", |
10 | | - "EVENT_ID_DATA": "adk/event/data", |
11 | | - "EVENT_ID_INIT": "adk/event/init", |
12 | | - "PANEL_ID": "adk/panel", |
13 | | - "PANEL_Title": "adk/addon", |
14 | | - "PARAM_Key": "adk/parameters", |
| 36 | + "ADDON_ID": "test", |
| 37 | + "EVENT_ID_BACK": "test/event/back", |
| 38 | + "EVENT_ID_DATA": "test/event/data", |
| 39 | + "EVENT_ID_INIT": "test/event/init", |
| 40 | + "PANEL_ID": "test/panel", |
| 41 | + "PANEL_Title": "ADK-TEST", |
| 42 | + "PARAM_Key": "test/parameters", |
15 | 43 | } |
16 | 44 | `); |
17 | 45 | }); |
|
0 commit comments