Skip to content

Commit

Permalink
fix: plugin config storage test suites
Browse files Browse the repository at this point in the history
  • Loading branch information
danpacho committed Jul 22, 2024
1 parent de55bbd commit 8426b9a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
7 changes: 0 additions & 7 deletions packages/helpers/src/plugin/__fixtures__/storage.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
{
"plugin": {
"staticConfig": {
"name": "value1",
"description": "value2"
},
"dynamicConfig": null
},
"myPlugin": {
"staticConfig": {
"name": "value1",
Expand Down
15 changes: 1 addition & 14 deletions packages/helpers/src/plugin/plugin.config.store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,6 @@ describe('PluginConfigStore', () => {
expect(store.store).toEqual({})
})

it('should add and retrieve plugin configurations', async () => {
const pluginName = 'plugin'
const config = { name: 'value1', description: 'value2' }

await store.addConfig(pluginName, { staticConfig: config })

expect(store.hasConfig(pluginName)).toBe(true)
expect(store.getConfig(pluginName)).toEqual({
staticConfig: config,
dynamicConfig: null,
})
})

it('should update plugin configurations', async () => {
const pluginName = 'myPlugin'
const initialConfig = { name: 'value1', description: 'value2' }
Expand All @@ -46,7 +33,7 @@ describe('PluginConfigStore', () => {
await store.addConfig(pluginName, { staticConfig: config })
await store.addConfig(pluginName, { staticConfig: config })

expect(Object.values(store.store).length).toBe(2)
expect(Object.values(store.store).length).toBe(1)
})

it('should inquire existing plugin configurations with args', async () => {
Expand Down

0 comments on commit 8426b9a

Please sign in to comment.