OSS-first docs

These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.

analytics.widget.add.test

Verifies adding widget to dashboard

  • Type: test-spec (test-spec)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @example.analytics-dashboard
  • Tags: analytics, widget, test
  • File: packages/examples/analytics-dashboard/src/dashboard/dashboard.test-spec.ts
  • field.key.label
    analytics.widget.add.test
    field.version.label
    1.0.0
    field.type.label
    test-spec (test-spec)
    field.title.label
    analytics.widget.add.test
    field.description.label

    Verifies adding widget to dashboard

  • Type: test-spec (test-spec)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @example.analytics-dashboard
  • Tags: analytics, widget, test
  • File: packages/examples/analytics-dashboard/src/dashboard/dashboard.test-spec.ts
  • field.tags.label
    analytics,widget,test
    field.owners.label
    @example.analytics-dashboard
    field.stability.label
    stable

    Verifies adding widget to dashboard

    Source Definition

    import { defineTestSpec } from '@lssm-tech/lib.contracts-spec/tests';
    
    export const AddWidgetTest = defineTestSpec({
    	meta: {
    		key: 'analytics.widget.add.test',
    		version: '1.0.0',
    		title: 'Add Widget Test',
    		description: 'Verifies adding widget to dashboard',
    		owners: ['@example.analytics-dashboard'],
    		tags: ['analytics', 'widget', 'test'],
    		stability: 'stable',
    	},
    	target: {
    		type: 'operation',
    		operation: { key: 'analytics.widget.add', version: '1.0.0' },
    	},
    	scenarios: [
    		{
    			key: 'success',
    			description: 'Successfully add widget',
    			when: {
    				operation: { key: 'analytics.widget.add', version: '1.0.0' },
    				input: {
    					dashboardId: 'dash-123',
    					type: 'chart',
    					queryId: 'q-1',
    					config: {},
    				},
    			},
    			then: [
    				{
    					type: 'expectOutput',
    					match: {
    						type: 'chart',
    						dashboardId: 'dash-123',
    					},
    				},
    			],
    		},
    		{
    			key: 'error-dashboard-not-found',
    			description: 'Fail when dashboard does not exist',
    			when: {
    				operation: { key: 'analytics.widget.add', version: '1.0.0' },
    				input: {
    					dashboardId: 'dash-999',
    					type: 'chart',
    					queryId: 'q-1',
    					config: {},
    				},
    			},
    			then: [
    				{
    					type: 'expectError',
    					messageIncludes: 'NOT_FOUND',
    				},
    			],
    		},
    	],
    });