Skip to content

Commit

Permalink
review: CXSPA-8968 changes due to review
Browse files Browse the repository at this point in the history
  • Loading branch information
Uli-Tiger committed Jan 22, 2025
1 parent 756d3f3 commit b00fe77
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{ 'configurator.attribute.notVisibleAttributeMsg' | cxTranslate }}
</div>

<div class="cx-header-label-row">
<div class="cx-header-label-container">
<label
id="{{ createAttributeUiKey('label', attribute.name) }}"
[class.cx-required-error]="showRequiredMessageForDomainAttribute$ | async"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ describe('ConfigAttributeHeaderComponent', () => {
component.groupId = 'testGroup';
component.attribute.required = false;
component.attribute.incomplete = true;
component.attribute.domainOnDemand = false;
component.attribute.uiType = Configurator.UiType.RADIOBUTTON;
component.groupType = Configurator.GroupType.ATTRIBUTE_GROUP;
component.isNavigationToGroupEnabled = true;
Expand Down Expand Up @@ -328,14 +329,14 @@ describe('ConfigAttributeHeaderComponent', () => {
);
});

it('should not render "show more options" button when domainOnDemand is false', () => {
it('should not render "Show Options" button when domainOnDemand is false', () => {
CommonConfiguratorTestUtilsService.expectElementNotPresent(
expect,
htmlElem,
'cx-configurator-show-options'
);
});
it('should render "show more options" button when domainOnDemand is true', () => {
it('should render "Show Options" button when domainOnDemand is true', () => {
component.attribute.domainOnDemand = true;
fixture.detectChanges();
CommonConfiguratorTestUtilsService.expectElementPresent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class MockConfiguratorCommonsService {
readAttributeDomain() {}
}

describe('ConfiguratorShowOptions', () => {
describe('ConfiguratorShowOptionsComponent', () => {
let component: ConfiguratorShowOptionsComponent;
let fixture: ComponentFixture<ConfiguratorShowOptionsComponent>;
let htmlElem: HTMLElement;
Expand Down Expand Up @@ -43,15 +43,15 @@ describe('ConfiguratorShowOptions', () => {
expect(component).toBeTruthy();
});

it('should render show options button', () => {
it('should render "Show Options" button', () => {
CommonConfiguratorTestUtilsService.expectElementPresent(
expect,
htmlElem,
'.btn'
);
});

it('should delegate to configurator commons service when clicking show more options button', () => {
it('should delegate to configurator commons service when clicking "Show Options" button', () => {
fixture.debugElement.query(By.css('.btn')).nativeElement.click();
expect(configuratorCommonsService.readAttributeDomain).toHaveBeenCalledWith(
component.attributeComponentContext.owner,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ import { ConfiguratorAttributeCompositionContext } from '../composition/configur
templateUrl: './configurator-show-options.component.html',
})
export class ConfiguratorShowOptionsComponent {
@Input() attributeComponentContext: ConfiguratorAttributeCompositionContext;

constructor(
protected configuratorCommonsService: ConfiguratorCommonsService
) {}

@Input() attributeComponentContext: ConfiguratorAttributeCompositionContext;

/**
* fires a request to read the attribute domain,
* so that all options of the attribute become visible on the UI
*/
showOptions() {
this.configuratorCommonsService.readAttributeDomain(
this.attributeComponentContext.owner,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ describe('ConfiguratorEffect', () => {
attributeKey: attributeKey,
});

it('should emit update price action abd success action with content in case connector call goes fine', () => {
it('should emit update price action and success action with content in case connector call goes fine', () => {
const readSuccessAction =
new ConfiguratorActions.ReadConfigurationSuccess(productConfiguration);
const updatePricesAction = new ConfiguratorActions.UpdatePriceSummary({
Expand Down Expand Up @@ -426,7 +426,7 @@ describe('ConfiguratorEffect', () => {
expect(configEffects.readAttributeDomain$).toBeObservable(expected);
});

it('must not emit anything in case source action is not covered', () => {
it('should not emit anything in case source action is not covered', () => {
const action = new ConfiguratorActions.ReadConfiguration({
configuration: productConfiguration,
groupId: groupId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
display: block;
}

.cx-header-label-row {
.cx-header-label-container {
display: flex;
flex-direction: column;
.btn {
Expand Down

0 comments on commit b00fe77

Please sign in to comment.