@atlaskit/tmp-editor-statsig 2.1.14 → 2.2.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,5 +1,7 @@
1
+ /// <reference types="jest" />
1
2
  import { type EditorExperimentOverrides } from './setup';
2
3
  import { type EditorExperimentsConfig } from './experiments-config';
4
+ type DescribeBody = Parameters<typeof describe>[1];
3
5
  /**
4
6
  * This is a utility function for testing editor experiments.
5
7
  *
@@ -7,11 +9,11 @@ import { type EditorExperimentsConfig } from './experiments-config';
7
9
  * ```ts
8
10
  * eeTest('example-boolean', {
9
11
  * true: () => {
10
- * expect(editorExperiment('example-boolean', true)).toBe(true);
11
- * expect(editorExperiment('example-boolean', false)).toBe(false);
12
+ * expect(editorExperiment('example-boolean', true)).toBe(true);
13
+ * expect(editorExperiment('example-boolean', false)).toBe(false);
12
14
  * },
13
15
  * false: () => {
14
- * expect(editorExperiment('example-boolean', false)).toBe(true);
16
+ * expect(editorExperiment('example-boolean', false)).toBe(true);
15
17
  * expect(editorExperiment('example-boolean', true)).toBe(false);
16
18
  * },
17
19
  * })
@@ -21,21 +23,217 @@ import { type EditorExperimentsConfig } from './experiments-config';
21
23
  * ```ts
22
24
  * eeTest('example-multivariate', {
23
25
  * one: () => {
24
- * expect(editorExperiment('example-multivariate', 'one')).toBe(true);
25
- * expect(editorExperiment('example-multivariate', 'two')).toBe(false);
26
+ * expect(editorExperiment('example-multivariate', 'one')).toBe(true);
27
+ * expect(editorExperiment('example-multivariate', 'two')).toBe(false);
26
28
  * },
27
29
  * two: () => {
28
- * expect(editorExperiment('example-multivariate', 'two')).toBe(true);
29
- * expect(editorExperiment('example-multivariate', 'one')).toBe(false);
30
+ * expect(editorExperiment('example-multivariate', 'two')).toBe(true);
31
+ * expect(editorExperiment('example-multivariate', 'one')).toBe(false);
30
32
  * },
31
33
  * three: () => {
32
- * expect(editorExperiment('example-multivariate', 'three')).toBe(true);
33
- * expect(editorExperiment('example-multivariate', 'one')).toBe(false);
34
+ * expect(editorExperiment('example-multivariate', 'three')).toBe(true);
35
+ * expect(editorExperiment('example-multivariate', 'one')).toBe(false);
34
36
  * },
35
37
  * })
36
38
  * ```
39
+ *
40
+ * API based on Legacy ffTest API
41
+ * - https://hello.atlassian.net/wiki/spaces/AF/pages/2569505829/Task+Testing+your+feature+flag+in+platform+and+product#Legacy-API-lEGACY
37
42
  */
38
- export declare function eeTest<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, cases: EditorExperimentsConfig[ExperimentName]['defaultValue'] extends string ? Record<EditorExperimentsConfig[ExperimentName]['defaultValue'], () => void | Promise<void>> : {
39
- true: () => void | Promise<void>;
40
- false: () => void | Promise<void>;
43
+ declare function eeTest<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, cases: EditorExperimentsConfig[ExperimentName]['defaultValue'] extends string ? Record<EditorExperimentsConfig[ExperimentName]['defaultValue'], DescribeBody> : {
44
+ true: DescribeBody;
45
+ false: DescribeBody;
41
46
  }, otherExperiments?: EditorExperimentOverrides): void;
47
+ declare namespace eeTest {
48
+ var describe: <ExperimentName extends "example-boolean" | "example-multivariate" | "test-new-experiments-package" | "basic-text-transformations" | "platform_editor_ai_command_palate_improvement" | "platform-editor-ai-condensed-floating-toobar" | "dnd-input-performance-optimisation" | "element-level-templates" | "add-media-from-url" | "nested-dnd" | "table-nested-dnd" | "insert-menu-in-right-rail" | "platform_editor_empty_line_prompt" | "support_table_in_comment" | "platform_editor_exp_lazy_node_views" | "platform_editor_ai_ai_button_block_elements" | "platform_renderer_table_sticky_scrollbar" | "nest-media-and-codeblock-in-quote" | "nested-expand-in-expand" | "platform_editor_ai_command_palette_post_ga" | "platform_editor_table_use_shared_state_hook" | "editor_ai_-_multi_prompts" | "comment_on_bodied_extensions">(experimentName: ExperimentName, describeName: string) => {
49
+ variant: (value: {
50
+ 'example-boolean': {
51
+ productKeys: {
52
+ confluence: string;
53
+ };
54
+ param: string;
55
+ typeGuard: typeof import("./type-guards").isBoolean;
56
+ defaultValue: boolean;
57
+ };
58
+ 'example-multivariate': {
59
+ productKeys: {
60
+ confluence: string;
61
+ };
62
+ param: string;
63
+ typeGuard: (value: unknown) => value is "one" | "two" | "three";
64
+ defaultValue: "one" | "two" | "three";
65
+ };
66
+ 'test-new-experiments-package': {
67
+ productKeys: {
68
+ confluence: string;
69
+ jira: string;
70
+ };
71
+ param: string;
72
+ typeGuard: typeof import("./type-guards").isBoolean;
73
+ defaultValue: boolean;
74
+ };
75
+ 'basic-text-transformations': {
76
+ productKeys: {
77
+ confluence: string;
78
+ };
79
+ param: string;
80
+ typeGuard: typeof import("./type-guards").isBoolean;
81
+ defaultValue: boolean;
82
+ };
83
+ platform_editor_ai_command_palate_improvement: {
84
+ productKeys: {
85
+ confluence: string;
86
+ };
87
+ param: string;
88
+ typeGuard: (value: unknown) => value is "test" | "control";
89
+ defaultValue: "test" | "control";
90
+ };
91
+ 'platform-editor-ai-condensed-floating-toobar': {
92
+ productKeys: {
93
+ confluence: string;
94
+ };
95
+ param: string;
96
+ typeGuard: (value: unknown) => value is "control" | "dropdown" | "editor_ai_button";
97
+ defaultValue: "control" | "dropdown" | "editor_ai_button";
98
+ };
99
+ 'dnd-input-performance-optimisation': {
100
+ productKeys: {
101
+ confluence: string;
102
+ };
103
+ param: string;
104
+ typeGuard: typeof import("./type-guards").isBoolean;
105
+ defaultValue: boolean;
106
+ };
107
+ 'element-level-templates': {
108
+ productKeys: {
109
+ confluence: string;
110
+ };
111
+ param: string;
112
+ typeGuard: typeof import("./type-guards").isBoolean;
113
+ defaultValue: boolean;
114
+ };
115
+ 'add-media-from-url': {
116
+ productKeys: {
117
+ confluence: string;
118
+ };
119
+ param: string;
120
+ typeGuard: typeof import("./type-guards").isBoolean;
121
+ defaultValue: boolean;
122
+ };
123
+ 'nested-dnd': {
124
+ productKeys: {
125
+ confluence: string;
126
+ };
127
+ param: string;
128
+ typeGuard: typeof import("./type-guards").isBoolean;
129
+ defaultValue: boolean;
130
+ };
131
+ 'table-nested-dnd': {
132
+ productKeys: {
133
+ confluence: string;
134
+ };
135
+ param: string;
136
+ typeGuard: typeof import("./type-guards").isBoolean;
137
+ defaultValue: boolean;
138
+ };
139
+ 'insert-menu-in-right-rail': {
140
+ productKeys: {
141
+ confluence: string;
142
+ };
143
+ param: string;
144
+ typeGuard: typeof import("./type-guards").isBoolean;
145
+ defaultValue: boolean;
146
+ };
147
+ platform_editor_empty_line_prompt: {
148
+ productKeys: {
149
+ confluence: string;
150
+ };
151
+ param: string;
152
+ typeGuard: typeof import("./type-guards").isBoolean;
153
+ defaultValue: boolean;
154
+ };
155
+ support_table_in_comment: {
156
+ productKeys: {
157
+ confluence: string;
158
+ };
159
+ param: string;
160
+ typeGuard: typeof import("./type-guards").isBoolean;
161
+ defaultValue: boolean;
162
+ };
163
+ platform_editor_exp_lazy_node_views: {
164
+ productKeys: {
165
+ confluence: string;
166
+ };
167
+ param: string;
168
+ typeGuard: typeof import("./type-guards").isBoolean;
169
+ defaultValue: boolean;
170
+ };
171
+ platform_editor_ai_ai_button_block_elements: {
172
+ productKeys: {
173
+ confluence: string;
174
+ };
175
+ param: string;
176
+ typeGuard: (value: unknown) => value is "test" | "control";
177
+ defaultValue: "test" | "control";
178
+ };
179
+ platform_renderer_table_sticky_scrollbar: {
180
+ productKeys: {
181
+ confluence: string;
182
+ };
183
+ param: string;
184
+ typeGuard: typeof import("./type-guards").isBoolean;
185
+ defaultValue: boolean;
186
+ };
187
+ 'nest-media-and-codeblock-in-quote': {
188
+ productKeys: {
189
+ confluence: string;
190
+ };
191
+ param: string;
192
+ typeGuard: typeof import("./type-guards").isBoolean;
193
+ defaultValue: boolean;
194
+ };
195
+ 'nested-expand-in-expand': {
196
+ productKeys: {
197
+ confluence: string;
198
+ };
199
+ param: string;
200
+ typeGuard: typeof import("./type-guards").isBoolean;
201
+ defaultValue: boolean;
202
+ };
203
+ platform_editor_ai_command_palette_post_ga: {
204
+ productKeys: {
205
+ confluence: string;
206
+ };
207
+ param: string;
208
+ typeGuard: (value: unknown) => value is "test" | "control";
209
+ defaultValue: "test" | "control";
210
+ };
211
+ platform_editor_table_use_shared_state_hook: {
212
+ productKeys: {
213
+ confluence: string;
214
+ };
215
+ param: string;
216
+ typeGuard: typeof import("./type-guards").isBoolean;
217
+ defaultValue: boolean;
218
+ };
219
+ 'editor_ai_-_multi_prompts': {
220
+ productKeys: {
221
+ confluence: string;
222
+ };
223
+ param: string;
224
+ typeGuard: (value: unknown) => value is "test" | "control";
225
+ defaultValue: "test" | "control";
226
+ };
227
+ comment_on_bodied_extensions: {
228
+ productKeys: {
229
+ confluence: string;
230
+ };
231
+ param: string;
232
+ typeGuard: typeof import("./type-guards").isBoolean;
233
+ defaultValue: boolean;
234
+ };
235
+ }[ExperimentName]["defaultValue"], describeBody: jest.EmptyFunction) => void;
236
+ each: (describeBody: jest.EmptyFunction) => void;
237
+ };
238
+ }
239
+ export { eeTest };
@@ -1,4 +1,4 @@
1
- declare function isBoolean(value: unknown): value is boolean;
1
+ import { isBoolean } from './type-guards';
2
2
  export type EditorExperimentsConfig = typeof editorExperimentsConfig;
3
3
  /**
4
4
  * When adding a new experiment, you need to add it here.
@@ -44,8 +44,8 @@ export declare const editorExperimentsConfig: {
44
44
  confluence: string;
45
45
  };
46
46
  param: string;
47
- typeGuard: (value: unknown) => value is "control" | "test";
48
- defaultValue: "control" | "test";
47
+ typeGuard: (value: unknown) => value is "test" | "control";
48
+ defaultValue: "test" | "control";
49
49
  };
50
50
  'platform-editor-ai-condensed-floating-toobar': {
51
51
  productKeys: {
@@ -132,8 +132,8 @@ export declare const editorExperimentsConfig: {
132
132
  confluence: string;
133
133
  };
134
134
  param: string;
135
- typeGuard: (value: unknown) => value is "control" | "test";
136
- defaultValue: "control" | "test";
135
+ typeGuard: (value: unknown) => value is "test" | "control";
136
+ defaultValue: "test" | "control";
137
137
  };
138
138
  platform_renderer_table_sticky_scrollbar: {
139
139
  productKeys: {
@@ -164,8 +164,8 @@ export declare const editorExperimentsConfig: {
164
164
  confluence: string;
165
165
  };
166
166
  param: string;
167
- typeGuard: (value: unknown) => value is "control" | "test";
168
- defaultValue: "control" | "test";
167
+ typeGuard: (value: unknown) => value is "test" | "control";
168
+ defaultValue: "test" | "control";
169
169
  };
170
170
  platform_editor_table_use_shared_state_hook: {
171
171
  productKeys: {
@@ -175,5 +175,20 @@ export declare const editorExperimentsConfig: {
175
175
  typeGuard: typeof isBoolean;
176
176
  defaultValue: boolean;
177
177
  };
178
+ 'editor_ai_-_multi_prompts': {
179
+ productKeys: {
180
+ confluence: string;
181
+ };
182
+ param: string;
183
+ typeGuard: (value: unknown) => value is "test" | "control";
184
+ defaultValue: "test" | "control";
185
+ };
186
+ comment_on_bodied_extensions: {
187
+ productKeys: {
188
+ confluence: string;
189
+ };
190
+ param: string;
191
+ typeGuard: typeof isBoolean;
192
+ defaultValue: boolean;
193
+ };
178
194
  };
179
- export {};
@@ -7,7 +7,7 @@ export declare let _overrides: Partial<{
7
7
  'example-multivariate': "one" | "two" | "three";
8
8
  'test-new-experiments-package': boolean;
9
9
  'basic-text-transformations': boolean;
10
- platform_editor_ai_command_palate_improvement: "control" | "test";
10
+ platform_editor_ai_command_palate_improvement: "test" | "control";
11
11
  'platform-editor-ai-condensed-floating-toobar': "control" | "dropdown" | "editor_ai_button";
12
12
  'dnd-input-performance-optimisation': boolean;
13
13
  'element-level-templates': boolean;
@@ -18,12 +18,14 @@ export declare let _overrides: Partial<{
18
18
  platform_editor_empty_line_prompt: boolean;
19
19
  support_table_in_comment: boolean;
20
20
  platform_editor_exp_lazy_node_views: boolean;
21
- platform_editor_ai_ai_button_block_elements: "control" | "test";
21
+ platform_editor_ai_ai_button_block_elements: "test" | "control";
22
22
  platform_renderer_table_sticky_scrollbar: boolean;
23
23
  'nest-media-and-codeblock-in-quote': boolean;
24
24
  'nested-expand-in-expand': boolean;
25
- platform_editor_ai_command_palette_post_ga: "control" | "test";
25
+ platform_editor_ai_command_palette_post_ga: "test" | "control";
26
26
  platform_editor_table_use_shared_state_hook: boolean;
27
+ 'editor_ai_-_multi_prompts': "test" | "control";
28
+ comment_on_bodied_extensions: boolean;
27
29
  }>;
28
30
  export declare let _product: 'confluence' | 'jira' | 'test' | undefined;
29
31
  /**
@@ -0,0 +1,2 @@
1
+ export declare function isBoolean(value: unknown): value is boolean;
2
+ export declare function oneOf<T extends string>(values: T[]): (value: unknown) => value is T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tmp-editor-statsig",
3
- "version": "2.1.14",
3
+ "version": "2.2.0",
4
4
  "description": "Temp plugin to ease use of statsig feature flags until platform feature flags are available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",