Skip to content

Commit

Permalink
test(core): Add e2e tests for entity duplication
Browse files Browse the repository at this point in the history
Relates to #627
  • Loading branch information
michaelbromley committed Feb 20, 2024
1 parent 477fe93 commit 0fa19b2
Show file tree
Hide file tree
Showing 6 changed files with 414 additions and 22 deletions.
37 changes: 37 additions & 0 deletions packages/common/src/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1550,6 +1550,26 @@ export type Discount = {
type: AdjustmentType;
};

export type DuplicateEntityError = ErrorResult & {
__typename?: 'DuplicateEntityError';
duplicationError: Scalars['String']['output'];
errorCode: ErrorCode;
message: Scalars['String']['output'];
};

export type DuplicateEntityInput = {
duplicatorInput: ConfigurableOperationInput;
entityId: Scalars['ID']['input'];
entityName: Scalars['String']['input'];
};

export type DuplicateEntityResult = DuplicateEntityError | DuplicateEntitySuccess;

export type DuplicateEntitySuccess = {
__typename?: 'DuplicateEntitySuccess';
newEntityId: Scalars['ID']['output'];
};

/** Returned when attempting to create a Customer with an email address already registered to an existing User. */
export type EmailAddressConflictError = ErrorResult & {
__typename?: 'EmailAddressConflictError';
Expand All @@ -1570,6 +1590,15 @@ export type EntityCustomFields = {
entityName: Scalars['String']['output'];
};

export type EntityDuplicatorDefinition = {
__typename?: 'EntityDuplicatorDefinition';
args: Array<ConfigArgDefinition>;
code: Scalars['String']['output'];
description: Scalars['String']['output'];
forEntities: Array<Scalars['String']['output']>;
requiresPermission: Array<Permission>;
};

export enum ErrorCode {
ALREADY_REFUNDED_ERROR = 'ALREADY_REFUNDED_ERROR',
CANCEL_ACTIVE_ORDER_ERROR = 'CANCEL_ACTIVE_ORDER_ERROR',
Expand All @@ -1579,6 +1608,7 @@ export enum ErrorCode {
COUPON_CODE_INVALID_ERROR = 'COUPON_CODE_INVALID_ERROR',
COUPON_CODE_LIMIT_ERROR = 'COUPON_CODE_LIMIT_ERROR',
CREATE_FULFILLMENT_ERROR = 'CREATE_FULFILLMENT_ERROR',
DUPLICATE_ENTITY_ERROR = 'DUPLICATE_ENTITY_ERROR',
EMAIL_ADDRESS_CONFLICT_ERROR = 'EMAIL_ADDRESS_CONFLICT_ERROR',
EMPTY_ORDER_LINE_SELECTION_ERROR = 'EMPTY_ORDER_LINE_SELECTION_ERROR',
FACET_IN_USE_ERROR = 'FACET_IN_USE_ERROR',
Expand Down Expand Up @@ -2803,6 +2833,7 @@ export type Mutation = {
deleteZone: DeletionResponse;
/** Delete a Zone */
deleteZones: Array<DeletionResponse>;
duplicateEntity: DuplicateEntityResult;
flushBufferedJobs: Success;
importProducts?: Maybe<ImportInfo>;
/** Authenticates the user using the native authentication strategy. This mutation is an alias for `authenticate({ native: { ... }})` */
Expand Down Expand Up @@ -3416,6 +3447,11 @@ export type MutationDeleteZonesArgs = {
};


export type MutationDuplicateEntityArgs = {
input: DuplicateEntityInput;
};


export type MutationFlushBufferedJobsArgs = {
bufferIds?: InputMaybe<Array<Scalars['String']['input']>>;
};
Expand Down Expand Up @@ -4955,6 +4991,7 @@ export type Query = {
customers: CustomerList;
/** Returns a list of eligible shipping methods for the draft Order */
eligibleShippingMethodsForDraftOrder: Array<ShippingMethodQuote>;
entityDuplicators: Array<EntityDuplicatorDefinition>;
facet?: Maybe<Facet>;
facetValues: FacetValueList;
facets: FacetList;
Expand Down
Loading

0 comments on commit 0fa19b2

Please sign in to comment.