Skip to content

Commit

Permalink
tests: Add widgets-loader
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
  • Loading branch information
patrickelectric committed Mar 22, 2024
1 parent c78cd8b commit 2aef8d9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/tests/libs/widgets-loader.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { expect, test } from 'vitest'

import { WidgetType } from '@/types/widgets'

test('Test widgets exist', async () => {
const loader = await Promise.allSettled(
Object.values(WidgetType).map((name) => import(`@/components/widgets/${name}.vue`))
)
const found_all_files = loader.every((file) => {
if (file.status == 'fulfilled') {
return true
}
return !file.reason.message.includes('Failed to load')
})
expect(found_all_files).toBe(true)
})

0 comments on commit 2aef8d9

Please sign in to comment.