Skip to content

Commit

Permalink
refactor(custom-views): minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
emmenko committed Oct 18, 2023
1 parent 39462a7 commit fb48612
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 37 deletions.
10 changes: 10 additions & 0 deletions models/custom-view/src/custom-view/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const defaultLocators = [
'products.product_details.general',
'products.product_variant_details.general',
'categories.category_details.external_search',
'customers.customer_addresses.edit_address',
'orders.order_details.custom_field',
'standalone_prices.standalone_price_details',
'discounts.product_discount_details.custom_fields',
'operations.import_log_details',
];
4 changes: 2 additions & 2 deletions models/custom-view/src/custom-view/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { fake, Generator } from '@commercetools-test-data/core';
import { createRelatedDates } from '@commercetools-test-data/utils';
import * as CustomViewPermission from '../custom-view-permission';
import * as CustomViewTypeSettingsForCustomPanel from '../custom-view-type-settings-for-custom-panel';
import { defaultLocators } from './constants';
import { TCustomView } from './types';
import { defaultLocators } from './utils';

const [getOlderDate, getNewerDate] = createRelatedDates();

Expand All @@ -19,7 +19,7 @@ const generator = Generator<TCustomView>({
locators: fake((f) =>
f.helpers.arrayElements(defaultLocators, {
min: 1,
max: defaultLocators.length,
max: 4,
})
),
permissions: fake(() => [
Expand Down
35 changes: 0 additions & 35 deletions models/custom-view/src/custom-view/utils.ts

This file was deleted.

0 comments on commit fb48612

Please sign in to comment.