test: LightningChannels mounts with Pinia — panel setup now uses the tx-explorer store
Demo images / Build & push demo images (push) Successful in 3m5s
Demo images / Build & push demo images (push) Successful in 3m5s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
0cd2164d24
commit
408c605001
@@ -1,5 +1,6 @@
|
|||||||
import { flushPromises, mount } from '@vue/test-utils'
|
import { flushPromises, mount } from '@vue/test-utils'
|
||||||
import { describe, expect, it, vi } from 'vitest'
|
import { describe, expect, it, vi } from 'vitest'
|
||||||
|
import { createPinia } from 'pinia'
|
||||||
import LightningChannels from '@/components/LightningChannelsPanel.vue'
|
import LightningChannels from '@/components/LightningChannelsPanel.vue'
|
||||||
import { rpcClient } from '@/api/rpc-client'
|
import { rpcClient } from '@/api/rpc-client'
|
||||||
|
|
||||||
@@ -44,7 +45,11 @@ describe('LightningChannels', () => {
|
|||||||
total_outbound: 60_000,
|
total_outbound: 60_000,
|
||||||
})
|
})
|
||||||
|
|
||||||
const wrapper = mount(LightningChannels)
|
// The panel's setup pulls a Pinia store via useTxExplorer — mount with a
|
||||||
|
// fresh Pinia or setup throws before the first render.
|
||||||
|
const wrapper = mount(LightningChannels, {
|
||||||
|
global: { plugins: [createPinia()] },
|
||||||
|
})
|
||||||
await flushPromises()
|
await flushPromises()
|
||||||
|
|
||||||
expect(wrapper.text()).toContain('peer-pubkey')
|
expect(wrapper.text()).toContain('peer-pubkey')
|
||||||
|
|||||||
Reference in New Issue
Block a user