-
Notifications
You must be signed in to change notification settings - Fork 8
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
fix(ui-library): harmonised property names #981
Conversation
There was a problem hiding this 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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
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); | ||
}); | ||
}); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
…x/878-form-caption-group-harmonized-property-names
* 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>
* 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>
#878