mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
docs: packages,social,hub (3 files)
This commit is contained in:
@@ -25,6 +25,7 @@ packages/
|
||||
- **nav_menu**: Navigation menu components
|
||||
- **dashboard**: Dashboard layout components
|
||||
- **notification_center**: Notification center components
|
||||
- **social_hub**: Social feed components with creator tools and live rooms
|
||||
|
||||
## Package Metadata Format
|
||||
|
||||
|
||||
20
packages/social_hub/tests/components.test.ts
Normal file
20
packages/social_hub/tests/components.test.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import components from '../seed/components.json'
|
||||
|
||||
describe('Social Hub Components', () => {
|
||||
it('should be a valid array', () => {
|
||||
expect(components).toBeInstanceOf(Array)
|
||||
})
|
||||
|
||||
it('should have valid component structure if components exist', () => {
|
||||
if (components.length > 0) {
|
||||
components.forEach((component: any) => {
|
||||
expect(component.id).toBeDefined()
|
||||
expect(component.type).toBeDefined()
|
||||
expect(typeof component.id).toBe('string')
|
||||
expect(typeof component.type).toBe('string')
|
||||
expect(component.children).toBeInstanceOf(Array)
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
28
packages/social_hub/tests/metadata.test.ts
Normal file
28
packages/social_hub/tests/metadata.test.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import metadata from '../seed/metadata.json'
|
||||
|
||||
describe('Social Hub Package Metadata', () => {
|
||||
it('should have valid package structure', () => {
|
||||
expect(metadata.packageId).toBe('social_hub')
|
||||
expect(metadata.name).toBe('Social Hub')
|
||||
expect(metadata.version).toBeDefined()
|
||||
expect(metadata.description).toBeDefined()
|
||||
})
|
||||
|
||||
it('should have correct package ID format', () => {
|
||||
expect(metadata.packageId).toMatch(/^[a-z_]+$/)
|
||||
})
|
||||
|
||||
it('should have semantic version', () => {
|
||||
expect(metadata.version).toMatch(/^\d+\.\d+\.\d+$/)
|
||||
})
|
||||
|
||||
it('should have exports defined', () => {
|
||||
expect(metadata.exports).toBeDefined()
|
||||
expect(metadata.exports.components).toBeInstanceOf(Array)
|
||||
})
|
||||
|
||||
it('should have dependencies array', () => {
|
||||
expect(metadata.dependencies).toBeInstanceOf(Array)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user