@umbraco/playwright-testhelpers 18.0.3 → 18.0.5

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.
@@ -147,6 +147,10 @@ export declare class DataTypeApiHelper {
147
147
  createRichTextEditorWithABlockWithBlockSettingThumbnail(richTextEditorName: string, contentElementTypeId: string, thumbnail: string): Promise<string | undefined>;
148
148
  createRichTextEditorWithABlockWithBlockSettingSettingsElementTypeKey(richTextEditorName: string, contentElementTypeId: string, settingsElementTypeId: string): Promise<string | undefined>;
149
149
  createRichTextEditorWithABlockWithBlockSettingDisplayInline(richTextEditorName: string, contentElementTypeId: string, displayInline: boolean): Promise<string | undefined>;
150
+ createDefaultContentPickerSourceDataType(name: string): Promise<string | undefined>;
151
+ createContentPickerSourceDataTypeWithDynamicRoot(name: string, originAlias: string): Promise<string | undefined>;
152
+ doesContentPickerHaveDynamicRoot(dataTypeName: string, originAlias: string): Promise<boolean>;
153
+ getContentPickerDynamicRoot(dataTypeName: string): Promise<any>;
150
154
  doesDataTypeHaveValue(dataTypeName: string, alias: string, value?: any, dataTypeData?: any): Promise<boolean>;
151
155
  doesApprovedColorHaveColor(dataTypeName: string, color: string): Promise<any>;
152
156
  createUploadDataType(name: string, fileExtensions?: string[]): Promise<string | undefined>;
@@ -1314,6 +1314,37 @@ class DataTypeApiHelper {
1314
1314
  async createRichTextEditorWithABlockWithBlockSettingDisplayInline(richTextEditorName, contentElementTypeId, displayInline) {
1315
1315
  return await this.createRichTextEditorWithABlockWithBlockSettings(richTextEditorName, contentElementTypeId, "", "", "", "", "", "", displayInline);
1316
1316
  }
1317
+ async createDefaultContentPickerSourceDataType(name) {
1318
+ await this.ensureNameNotExists(name);
1319
+ const dataType = new json_models_builders_1.MultiNodeTreePickerDataTypeBuilder()
1320
+ .withName(name)
1321
+ .build();
1322
+ return await this.save(dataType);
1323
+ }
1324
+ async createContentPickerSourceDataTypeWithDynamicRoot(name, originAlias) {
1325
+ await this.ensureNameNotExists(name);
1326
+ const dataType = new json_models_builders_1.MultiNodeTreePickerDataTypeBuilder()
1327
+ .withName(name)
1328
+ .addStartNode()
1329
+ .withType('content')
1330
+ .withOriginAlias(originAlias)
1331
+ .done()
1332
+ .build();
1333
+ return await this.save(dataType);
1334
+ }
1335
+ async doesContentPickerHaveDynamicRoot(dataTypeName, originAlias) {
1336
+ const dataType = await this.getByName(dataTypeName);
1337
+ const startNodeValue = dataType.values.find((item) => item.alias === 'startNode');
1338
+ if (!startNodeValue?.value?.dynamicRoot) {
1339
+ return false;
1340
+ }
1341
+ return startNodeValue.value.dynamicRoot.originAlias === originAlias;
1342
+ }
1343
+ async getContentPickerDynamicRoot(dataTypeName) {
1344
+ const dataType = await this.getByName(dataTypeName);
1345
+ const startNodeValue = dataType.values.find((item) => item.alias === 'startNode');
1346
+ return startNodeValue?.value?.dynamicRoot;
1347
+ }
1317
1348
  async doesDataTypeHaveValue(dataTypeName, alias, value, dataTypeData) {
1318
1349
  const dataType = dataTypeData || await this.getByName(dataTypeName);
1319
1350
  const valueData = dataType.values.find(item => item.alias === alias);