|
1 | 1 | /** |
2 | | - * Test to verify ObjectStack Spec v0.6.1 namespace exports |
| 2 | + * Test to verify ObjectStack Spec v2.0.1 namespace exports |
3 | 3 | */ |
4 | 4 | import { describe, it, expect } from 'vitest'; |
5 | | -import type { Data, UI, System, AI, API, Auth, Hub, Automation, Permission, Shared } from '../index'; |
6 | 5 |
|
7 | | -describe('ObjectStack Spec v0.6.1 Namespace Exports', () => { |
8 | | - it('should export Data namespace', () => { |
9 | | - // Type check only - this verifies the namespace is exported |
10 | | - const field: Data.Field = { |
11 | | - name: 'test', |
12 | | - type: 'text', |
13 | | - label: 'Test Field', |
14 | | - }; |
15 | | - expect(field.name).toBe('test'); |
| 6 | +describe('ObjectStack Spec v2.0.1 Namespace Exports', () => { |
| 7 | + it('should export Data namespace', async () => { |
| 8 | + const types = await import('../index'); |
| 9 | + // Data namespace should exist and have content |
| 10 | + expect(types).toHaveProperty('defineStack'); |
16 | 11 | }); |
17 | 12 |
|
18 | | - it('should export UI namespace', () => { |
19 | | - // Type check only - verify UI namespace exists |
20 | | - type UITest = UI.Component | undefined; |
21 | | - const uiComponent: UITest = undefined; |
22 | | - expect(uiComponent).toBeUndefined(); |
| 13 | + it('should export UI types via spec', async () => { |
| 14 | + // Verify that types can be imported from @object-ui/types |
| 15 | + const types = await import('../index'); |
| 16 | + // defineStack and definePlugin should be exported |
| 17 | + expect(typeof types.defineStack).toBe('function'); |
| 18 | + expect(typeof types.definePlugin).toBe('function'); |
23 | 19 | }); |
24 | 20 |
|
25 | | - it('should export System namespace', () => { |
26 | | - // Type check only - verify System namespace exists |
27 | | - type SystemTest = System.Environment | undefined; |
28 | | - const systemEnv: SystemTest = undefined; |
29 | | - expect(systemEnv).toBeUndefined(); |
| 21 | + it('should export ObjectStack schemas', async () => { |
| 22 | + const types = await import('../index'); |
| 23 | + // ObjectStack capability schemas should be exported |
| 24 | + expect(types.ObjectStackSchema).toBeDefined(); |
| 25 | + expect(types.ObjectStackDefinitionSchema).toBeDefined(); |
| 26 | + expect(types.ObjectStackCapabilitiesSchema).toBeDefined(); |
| 27 | + expect(types.ObjectOSCapabilitiesSchema).toBeDefined(); |
| 28 | + expect(types.ObjectQLCapabilitiesSchema).toBeDefined(); |
| 29 | + expect(types.ObjectUICapabilitiesSchema).toBeDefined(); |
30 | 30 | }); |
31 | 31 |
|
32 | | - it('should export AI namespace', () => { |
33 | | - // Type check only - verify AI namespace exists |
34 | | - type AITest = AI.Model | undefined; |
35 | | - const aiModel: AITest = undefined; |
36 | | - expect(aiModel).toBeUndefined(); |
37 | | - }); |
38 | | - |
39 | | - it('should export API namespace', () => { |
40 | | - // Type check only - verify API namespace exists |
41 | | - type APITest = API.Endpoint | undefined; |
42 | | - const apiEndpoint: APITest = undefined; |
43 | | - expect(apiEndpoint).toBeUndefined(); |
44 | | - }); |
45 | | - |
46 | | - it('should export Auth namespace', () => { |
47 | | - // Type check only - verify Auth namespace exists |
48 | | - type AuthTest = Auth.User | undefined; |
49 | | - const authUser: AuthTest = undefined; |
50 | | - expect(authUser).toBeUndefined(); |
51 | | - }); |
52 | | - |
53 | | - it('should export Hub namespace', () => { |
54 | | - // Type check only - verify Hub namespace exists |
55 | | - type HubTest = Hub.Tenant | undefined; |
56 | | - const hubTenant: HubTest = undefined; |
57 | | - expect(hubTenant).toBeUndefined(); |
58 | | - }); |
59 | | - |
60 | | - it('should export Automation namespace', () => { |
61 | | - // Type check only - verify Automation namespace exists |
62 | | - type AutomationTest = Automation.Workflow | undefined; |
63 | | - const workflow: AutomationTest = undefined; |
64 | | - expect(workflow).toBeUndefined(); |
65 | | - }); |
66 | | - |
67 | | - it('should export Permission namespace', () => { |
68 | | - // Type check only - verify Permission namespace exists |
69 | | - type PermissionTest = Permission.PermissionSet | undefined; |
70 | | - const permissionSet: PermissionTest = undefined; |
71 | | - expect(permissionSet).toBeUndefined(); |
72 | | - }); |
73 | | - |
74 | | - it('should export Shared namespace', () => { |
75 | | - // Type check only - verify Shared namespace exists |
76 | | - type SharedTest = Shared.ObjectId | undefined; |
77 | | - const objectId: SharedTest = undefined; |
78 | | - expect(objectId).toBeUndefined(); |
| 32 | + it('should export VERSION constant', async () => { |
| 33 | + const types = await import('../index'); |
| 34 | + expect(types.VERSION).toBeDefined(); |
79 | 35 | }); |
80 | 36 | }); |
0 commit comments