Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui-library): harmonised property names #981

Merged

Conversation

JpunktWpunkt
Copy link
Contributor

Copy link
Contributor

@thrbnhrtmnn thrbnhrtmnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM in Storybook, cant evaluate the other parts though

One small thing we could fix, while changing the index.stories.ts for the form caption group would be the default text of the default story messages from "hint" to "Hint-Message-Text" and from "error" to "Error-Message-Text".

Also we should fix the link to the Form Caption in the Intro. It broke when we got rid of the component grouping.

angsherpa456
angsherpa456 previously approved these changes Mar 7, 2024
Copy link
Contributor

@angsherpa456 angsherpa456 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ChristianHoffmannS2 ChristianHoffmannS2 changed the title fix(ui-library): harmonized property names fix(ui-library): harmonised property names Mar 8, 2024
@faselbaum faselbaum added the 🦹 needs:reviewers (code) The issue or pull request needs additional code reviewers label Mar 8, 2024
Copy link
Contributor

@thrbnhrtmnn thrbnhrtmnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also LGTM, we can approve and merge once the conflict is solved

@faselbaum faselbaum self-requested a review March 11, 2024 08:54
@faselbaum faselbaum removed the 🦹 needs:reviewers (code) The issue or pull request needs additional code reviewers label Mar 11, 2024
Comment on lines 3 to 49
import { BlrRangeLegendMinMaxSliderRenderFunction } from './renderFunction';
import type { BlrRangeLegendMinMaxSliderType } from '.';

import { expect, fixture } from "@open-wc/testing";
import { expect, fixture } from '@open-wc/testing';
import { querySelectorAllDeep, querySelectorDeep } from 'query-selector-shadow-dom';

const sampleParams: BlrRangeLegendMinMaxSliderType = {
theme: 'Light',
rangeInputId: 'range-legend-cmpt',
startValue: '200$',
endValue: '400$',
size: 'lg',
list: [
'100$',
'200$',
'300$',
'400$',
'500$',
],
stepFactor: 1,
btnVariant: 'primary',
incrementIcon: 'blrPlus',
decrementIcon: 'blrMinus',
onChange: () => null,
theme: 'Light',
rangeInputId: 'range-legend-cmpt',
startValue: '200$',
endValue: '400$',
size: 'lg',
list: ['100$', '200$', '300$', '400$', '500$'],
stepFactor: 1,
btnVariant: 'primary',
incrementIcon: 'blrPlus',
decrementIcon: 'blrMinus',
onChange: () => null,
};

describe('blr-range-legend-min-max-slider', () => {
it('is having two sliders containing the right className', async () => {
const element = await fixture(BlrRangeLegendMinMaxSliderRenderFunction(sampleParams));
const inputWrapper = querySelectorDeep('.range-wrapper', element.getRootNode() as HTMLElement);
const textareas = querySelectorAllDeep('input', inputWrapper?.getRootNode() as HTMLElement);
const classNameInputOne = textareas[0]?.className;
const classNameInputTwo = textareas[1]?.className;
expect(classNameInputOne).to.contain('range');
expect(classNameInputTwo).to.contain('range');
});
it('is having two sliders containing the right className', async () => {
const element = await fixture(BlrRangeLegendMinMaxSliderRenderFunction(sampleParams));
const inputWrapper = querySelectorDeep('.range-wrapper', element.getRootNode() as HTMLElement);
const textareas = querySelectorAllDeep('input', inputWrapper?.getRootNode() as HTMLElement);
const classNameInputOne = textareas[0]?.className;
const classNameInputTwo = textareas[1]?.className;

expect(classNameInputOne).to.contain('range');
expect(classNameInputTwo).to.contain('range');
});

it('properly renders legend', async () => {
const element = await fixture(BlrRangeLegendMinMaxSliderRenderFunction(sampleParams));
const inputWrapper = querySelectorDeep('.range-wrapper', element.getRootNode() as HTMLElement);
const rangeNumbersElement = querySelectorDeep('.range__numbers', inputWrapper?.getRootNode() as HTMLElement);
const allRangePoints = querySelectorAllDeep('.range__point', rangeNumbersElement?.getRootNode() as HTMLParagraphElement);
it('properly renders legend', async () => {
const element = await fixture(BlrRangeLegendMinMaxSliderRenderFunction(sampleParams));
const inputWrapper = querySelectorDeep('.range-wrapper', element.getRootNode() as HTMLElement);
const rangeNumbersElement = querySelectorDeep('.range__numbers', inputWrapper?.getRootNode() as HTMLElement);
const allRangePoints = querySelectorAllDeep(
'.range__point',
rangeNumbersElement?.getRootNode() as HTMLParagraphElement
);

allRangePoints.forEach(point => {
expect(point).to.exist;
});
expect(allRangePoints.length).to.equal(sampleParams.list.length)
allRangePoints.forEach((point) => {
expect(point).to.exist;
});
})
expect(allRangePoints.length).to.equal(sampleParams.list.length);
});
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatting changes seem out of scope for this PR and could be removed.
What do you think? I'm curious, especially since i'm new to the team.
Should we just fix these things on the fly whenever we encounter them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I have no glue. I think this came when I solved the merge conflict from develop. I don't touch this file in this way.

faselbaum
faselbaum previously approved these changes Mar 11, 2024
@faselbaum faselbaum added 🦹 needs:reviewers (code) The issue or pull request needs additional code reviewers and removed 🦹 needs:reviewers (code) The issue or pull request needs additional code reviewers labels Mar 11, 2024
…x/878-form-caption-group-harmonized-property-names
@thrbnhrtmnn thrbnhrtmnn merged commit a54d6ab into develop Mar 14, 2024
4 of 5 checks passed
@thrbnhrtmnn thrbnhrtmnn deleted the fix/878-form-caption-group-harmonized-property-names branch March 14, 2024 17:23
ChristianHoffmannS2 pushed a commit that referenced this pull request Mar 26, 2024
* fix(ui-library): harmonized property names

* fix(storybook): changed values after review

* fix(ui-library): harmonized naming in form-caption and dependencie files

---------

Co-authored-by: David Kennedy <david.a.kennedy@accenture.com>
Co-authored-by: Thorben Hartmann <122102805+thrbnhrtmnn@users.noreply.github.com>
ChristianHoffmannS2 pushed a commit that referenced this pull request Mar 26, 2024
* fix(ui-library): harmonized property names

* fix(storybook): changed values after review

* fix(ui-library): harmonized naming in form-caption and dependencie files

---------

Co-authored-by: David Kennedy <david.a.kennedy@accenture.com>
Co-authored-by: Thorben Hartmann <122102805+thrbnhrtmnn@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Form Caption Group - Ensure Consistency between Storybook Documentation and Codebase Property Names
6 participants