@contractspec/example.learning-journey-crm-onboarding 1.46.1 → 1.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,4 @@
1
- import type {
2
- PresentationSpecMeta,
3
- PresentationSpec,
4
- } from '@contractspec/lib.contracts';
5
- import { StabilityEnum } from '@contractspec/lib.contracts';
1
+ import { definePresentation, StabilityEnum, type PresentationSpecMeta } from '@contractspec/lib.contracts';
6
2
  import { CrmOnboardingTrackModel } from '../operations';
7
3
 
8
4
  const baseMeta: Pick<
@@ -18,7 +14,7 @@ const baseMeta: Pick<
18
14
  context: 'CRM onboarding journey',
19
15
  };
20
16
 
21
- export const CrmOnboardingTrackPresentation: PresentationSpec = {
17
+ export const CrmOnboardingTrackPresentation = definePresentation({
22
18
  meta: {
23
19
  key: 'learning.journey.crm.track',
24
20
  version: '1.0.0',
@@ -32,9 +28,9 @@ export const CrmOnboardingTrackPresentation: PresentationSpec = {
32
28
  props: CrmOnboardingTrackModel,
33
29
  },
34
30
  targets: ['react', 'markdown', 'application/json'],
35
- };
31
+ });
36
32
 
37
- export const CrmOnboardingWidgetPresentation: PresentationSpec = {
33
+ export const CrmOnboardingWidgetPresentation = definePresentation({
38
34
  meta: {
39
35
  key: 'learning.journey.crm.widget',
40
36
  version: '1.0.0',
@@ -47,7 +43,7 @@ export const CrmOnboardingWidgetPresentation: PresentationSpec = {
47
43
  componentKey: 'LearningTrackProgressWidget',
48
44
  },
49
45
  targets: ['react'],
50
- };
46
+ });
51
47
 
52
48
  export const crmOnboardingPresentations = [
53
49
  CrmOnboardingTrackPresentation,
@@ -0,0 +1,31 @@
1
+ import { defineTestSpec } from '@contractspec/lib.contracts';
2
+
3
+ export const GetTrackTest = defineTestSpec({
4
+ meta: {
5
+ key: 'learningJourney.crmOnboarding.getTrack.test',
6
+ version: '1.0.0',
7
+ stability: 'experimental',
8
+ owners: ['@example.learning-journey-crm-onboarding'],
9
+ description: 'Test for getting CRM onboarding track',
10
+ tags: ['test'],
11
+ },
12
+ target: {
13
+ type: 'operation',
14
+ operation: {
15
+ key: 'learningJourney.crmOnboarding.getTrack',
16
+ version: '1.0.0',
17
+ },
18
+ },
19
+ scenarios: [
20
+ {
21
+ key: 'success',
22
+ when: { operation: { key: 'learningJourney.crmOnboarding.getTrack' } },
23
+ then: [{ type: 'expectOutput', match: {} }],
24
+ },
25
+ {
26
+ key: 'error',
27
+ when: { operation: { key: 'learningJourney.crmOnboarding.getTrack' } },
28
+ then: [{ type: 'expectError' }],
29
+ },
30
+ ],
31
+ });