Skip to content
Merged
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
27 changes: 27 additions & 0 deletions semcore/select/__tests__/select.browser-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,33 @@ test.describe(`${TAG.VISUAL} `, () => {
});
});

test('Verify indeterminate checkbox has default size when Select size is omitted', {
tag: [TAG.PRIORITY_HIGH, '@select', '@checkbox'],
}, async ({ page }) => {
await loadPage(page, 'stories/components/select/tests/examples/options_checkbox_group_and_hint.tsx', 'en', {
omitSize: true,
showLabel: false,
option2ShowCheckbox: false,
option3ShowCheckbox: true,
option3CheckboxIndeterminate: true,
showGroup: false,
});

await locators.selectTrigger(page).click();
await locators.options(page).first().waitFor({ state: 'visible' });

const checkbox = page.locator('[data-ui-name="Select.Option.Checkbox"]');
await expect(checkbox).toHaveCount(1);
await expect(checkbox).toHaveCSS('width', '16px');
await expect(checkbox).toHaveCSS('height', '16px');

const indicatorSize = await checkbox.evaluate((element) => {
const style = window.getComputedStyle(element, '::after');
return { width: style.width, height: style.height };
});
expect(indicatorSize).toEqual({ width: '8px', height: '2px' });
});

const subcomponentsConfigVariables = [
// Test trigger size and state variations
{ description: 'trigger M normal, list M, no search', triggerSize: 'm', triggerState: 'normal', triggerDisabled: false, triggerLoading: false, listSize: 'm', showInputSearch: false },
Expand Down
3 changes: 1 addition & 2 deletions semcore/select/src/Select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,9 @@ class RootSelect extends AbstractDropdown {
}

getOptionCheckboxProps() {
const { size, resolveColor } = this.asProps;
const { resolveColor } = this.asProps;

return {
size,
resolveColor,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import React from 'react';
export type SelectAdvancedConfigProps = SelectProps & {
// Main Select props
size?: 'm' | 'l';
omitSize?: boolean;
labelText?: string;
showLabel?: boolean;
triggerPlaceholder?: string;
Expand Down Expand Up @@ -62,6 +63,7 @@ const Demo = (props: SelectAdvancedConfigProps) => {
showLabel = true,
triggerPlaceholder = 'Select an option',
size = 'm',
omitSize = false,
disabled = undefined,
state = undefined,
visible = undefined,
Expand Down Expand Up @@ -120,7 +122,7 @@ const Demo = (props: SelectAdvancedConfigProps) => {
</Text>
)}
<Select
size={size}
{...(!omitSize ? { size } : {})}
disabled={disabled}
state={state}
visible={visible}
Expand Down Expand Up @@ -209,6 +211,7 @@ export const defaultProps: SelectAdvancedConfigProps = {
showLabel: true,
triggerPlaceholder: 'Select an option',
size: 'm',
omitSize: false,
disabled: undefined,
state: undefined,

Expand Down
Loading