invariant.spec.ts 930 B

1234567891011121314151617181920212223
  1. import { describe, expect, it } from 'vitest'
  2. import { Context } from 'cordis'
  3. import * as ModelsInvariant from '@deepseek-ai/dsh-client-ui-models/invariant'
  4. import InvariantService from '@deepseek-ai/dsh-invariants'
  5. import { ModelsSection } from '../src/client/ModelsSection.tsx'
  6. describe('invariant companion', () => {
  7. it('registers under the package name with an empty installer', async () => {
  8. const ctx = new Context()
  9. await ctx.plugin(InvariantService, { enabled: true })
  10. await expect(ctx.plugin(ModelsInvariant).await()).resolves.toBeDefined()
  11. })
  12. it('node-half apply is a no-op host placeholder', async () => {
  13. const { apply } = await import('@deepseek-ai/dsh-client-ui-models')
  14. apply()
  15. expect(true).toBe(true) // reaching here without throw is the contract
  16. })
  17. it('renders null until the shell injects the section dependencies', () => {
  18. expect(ModelsSection({})).toBeNull()
  19. })
  20. })