Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,16 @@ describe('OccConfiguratorVariantNormalizer', () => {
expect(attributeSSIWithValues.incomplete).toBe(false);
});

it('should set incomplete by single-selection-image type with retract option correctly', () => {
attributeSSIWithValues.selectedSingleValue =
Configurator.RetractValueCode;
occConfiguratorVariantNormalizer.compileAttributeIncomplete(
attributeSSIWithValues
);

expect(attributeSSIWithValues.incomplete).toBe(true);
});

it('should set incomplete by checkbox type correctly', () => {
occConfiguratorVariantNormalizer.compileAttributeIncomplete(
attributeCheckboxWOValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ export class OccConfiguratorVariantNormalizer
Configurator.UiType.RADIOBUTTON_ADDITIONAL_INPUT,
Configurator.UiType.DROPDOWN_ADDITIONAL_INPUT,
Configurator.UiType.DROPDOWN,
Configurator.UiType.SINGLE_SELECTION_IMAGE,
];
const inputTypes = [
Configurator.UiType.NUMERIC,
Expand All @@ -554,8 +555,6 @@ export class OccConfiguratorVariantNormalizer
const uiType = attribute.uiType ?? Configurator.UiType.NOT_IMPLEMENTED;
if (singleValueTypes.includes(uiType)) {
this.compileAttributeIncompleteSingleLevel(attribute);
} else if (uiType === Configurator.UiType.SINGLE_SELECTION_IMAGE) {
this.compileAttributeIncompleteSingleSelectionImage(attribute);
} else if (inputTypes.includes(uiType)) {
this.compileAttributeIncompleteInputTypes(attribute);
} else if (multiValueTypes.includes(uiType)) {
Expand All @@ -573,13 +572,7 @@ export class OccConfiguratorVariantNormalizer
attribute.incomplete = true;
}
}
protected compileAttributeIncompleteSingleSelectionImage(
attribute: Configurator.Attribute
): void {
if (!attribute.selectedSingleValue) {
attribute.incomplete = true;
}
}

protected compileAttributeIncompleteInputTypes(
attribute: Configurator.Attribute
): void {
Expand Down
Loading