diff --git a/packages/oss-components/src/components/o-s-s/infinite-select.ts b/packages/oss-components/src/components/o-s-s/infinite-select.ts index a4b3d7a3c..65bf02310 100644 --- a/packages/oss-components/src/components/o-s-s/infinite-select.ts +++ b/packages/oss-components/src/components/o-s-s/infinite-select.ts @@ -272,10 +272,17 @@ export default class OSSInfiniteSelect extends Component( `[data-internal-id="${this.elementId}"] .upf-infinite-select__items-container li` - )[index] as HTMLElement; - el?.focus(); + )[index]; + } + + private _isItemDisabledAt(index: number): boolean { + return Boolean(this._itemElementAt(index)?.querySelector(':scope > .oss-infinite-select-option--disabled')); } private _focusInput(): void { @@ -310,8 +317,11 @@ export default class OSSInfiniteSelect extends Component
{{#if this.isSelectionMultiple}} - + {{/if}} {{#if @prefixAvatar}}
-
+
{{#each @selectedItems as |selectedItem index|}} {{yield selectedItem index to="selected-item"}} @@ -48,7 +56,21 @@ {{on-click-outside this.onClickOutside useCapture=@captureClickOutside}} > <:option as |item index|> - {{yield item index to="option-item"}} + {{#if (has-block "row")}} + {{yield + item + (component + "o-s-s/infinite-select/option" + selectionType="multiple" + selected=(this.isSelected item=item) + onSelect=(fn this.onSelect item) + ) + index + to="row" + }} + {{else}} + {{yield item index to="option-item"}} + {{/if}} <:empty-state> @@ -71,7 +93,21 @@ {{on-click-outside this.onClickOutside useCapture=@captureClickOutside}} > <:option as |item index|> - {{yield item index to="option-item"}} + {{#if (has-block "row")}} + {{yield + item + (component + "o-s-s/infinite-select/option" + selectionType="multiple" + selected=(this.isSelected item=item) + onSelect=(fn this.onSelect item) + ) + index + to="row" + }} + {{else}} + {{yield item index to="option-item"}} + {{/if}} {{/if}} diff --git a/packages/oss-components/src/components/o-s-s/power-select.stories.gts b/packages/oss-components/src/components/o-s-s/power-select.stories.gts index 1c4d1b6e2..92de88db4 100644 --- a/packages/oss-components/src/components/o-s-s/power-select.stories.gts +++ b/packages/oss-components/src/components/o-s-s/power-select.stories.gts @@ -13,7 +13,8 @@ const Template = (args) => ({ @onSearch={{this.onSearch}} @onChange={{this.onChange}} @loading={{this.loading}} @borderless={{this.borderless}} @hasError={{this.hasError}} @feedbackMessage={{this.feedbackMessage}} @loadingMore={{this.loadingMore}} @placeholder={{this.placeholder}} @searchPlaceholder={{this.searchPlaceholder}} - @onBottomReached={{this.onBottomReached}} @addressableAs={{this.addressableAs}}> + @onBottomReached={{this.onBottomReached}} @addressableAs={{this.addressableAs}} + @disabled={{this.disabled}}> <:selected-item as |selectedItem|> {{selectedItem}} @@ -32,6 +33,7 @@ const defaultArgs = { loading: false, loadingMore: false, borderless: false, + disabled: false, placeholder: 'My placeholder', searchPlaceholder: 'My search placeholder', addressableAs: undefined, @@ -91,6 +93,16 @@ export default { }, control: { type: 'boolean' } }, + disabled: { + description: 'Disable the component: the dropdown cannot be opened', + table: { + type: { + summary: 'boolean' + }, + defaultValue: { summary: 'false' } + }, + control: { type: 'boolean' } + }, feedbackMessage: { description: 'A success, warning or error message that will be displayed below the input-group.', table: { @@ -194,6 +206,24 @@ export default { } }; +const WithRowNamedBlockTemplate = (args) => ({ + template: hbs` +
+ + <:selected-item as |selectedItem|> + {{selectedItem}} + + <:row as |item Option|> + +
+ `, + context: args +}); + export const Default = {}; export const WithoutSelectedItem = { @@ -201,3 +231,16 @@ export const WithoutSelectedItem = { selectedItems: [] } }; + +export const WithRowNamedBlock = { + render: WithRowNamedBlockTemplate, + args: { + items: [...FAKE_ITEMS, ...FAKE_SELECTED_ITEMS] + } +}; + +export const Disabled = { + args: { + disabled: true + } +}; diff --git a/packages/oss-components/src/components/o-s-s/power-select.ts b/packages/oss-components/src/components/o-s-s/power-select.ts index 5b061995b..3f92ac38a 100644 --- a/packages/oss-components/src/components/o-s-s/power-select.ts +++ b/packages/oss-components/src/components/o-s-s/power-select.ts @@ -1,3 +1,4 @@ +import { helper } from '@ember/component/helper'; import { assert } from '@ember/debug'; import { action } from '@ember/object'; import { scheduleOnce } from '@ember/runloop'; @@ -19,6 +20,7 @@ interface OSSPowerSelectArgs extends BaseDropdownArgs { onSearch?: (keyword: string) => void; onBottomReached?: () => void; borderless?: boolean; + disabled?: boolean; } const DEFAULT_PLACEHOLDER = 'Select an item'; @@ -26,6 +28,10 @@ const DEFAULT_PLACEHOLDER = 'Select an item'; export default class OSSPowerSelect extends BaseDropdown { cleanupDrodpownAutoplacement?: () => void; + isSelected = helper((_, { item }: { item: any }): boolean => { + return (this.args.selectedItems ?? []).includes(item); + }); + get placeholder(): string { return this.args.placeholder ?? DEFAULT_PLACEHOLDER; } @@ -41,9 +47,9 @@ export default class OSSPowerSelect extends BaseDropdown { } @action - ensureBlockPresence(hasSelectedItem: boolean, hasOptionItem: boolean): void | never { + ensureBlockPresence(hasSelectedItem: boolean, hasOptionItem: boolean, hasRow: boolean): void | never { assert(`[component][OSS::PowerSelect] You must pass selected-item named block`, hasSelectedItem); - assert(`[component][OSS::PowerSelect] You must pass option-item named block`, hasOptionItem); + assert(`[component][OSS::PowerSelect] You must pass option-item or row named block`, hasOptionItem || hasRow); } @action @@ -62,6 +68,8 @@ export default class OSSPowerSelect extends BaseDropdown { @action toggleDropdown(event: MouseEvent): void { + if (this.args.disabled) return; + super.toggleDropdown(event); if (!this.isOpen) { diff --git a/packages/oss-components/src/components/o-s-s/select.hbs b/packages/oss-components/src/components/o-s-s/select.hbs index 5b0cf6b9d..586b79ee0 100644 --- a/packages/oss-components/src/components/o-s-s/select.hbs +++ b/packages/oss-components/src/components/o-s-s/select.hbs @@ -1,7 +1,6 @@
<:option as |item index|> -
- {{#if (has-block "option")}} + {{#if (has-block "row")}} + {{yield + item + (component + "o-s-s/infinite-select/option" + selectionType="single" + selected=(this.isSelected item=item) + onSelect=(fn this.onSelect item) + ) + index + to="row" + }} + {{else if (has-block "option")}} +
{{yield item index to="option"}} - {{/if}} - {{#if (eq @value item)}} - - {{/if}} -
+ {{#if (this.isSelected item=item)}} + + {{/if}} +
+ {{else}} + + {{/if}} <:empty-state> {{yield to="empty-state"}} @@ -78,17 +96,36 @@ {{on "click" this.noop}} > <:option as |item index|> -
- {{#if (has-block "option")}} + {{#if (has-block "row")}} + {{yield + item + (component + "o-s-s/infinite-select/option" + selectionType="single" + selected=(this.isSelected item=item) + onSelect=(fn this.onSelect item) + ) + index + to="row" + }} + {{else if (has-block "option")}} +
{{yield item index to="option"}} - {{/if}} - {{#if (eq @value item)}} - - {{/if}} -
+ {{#if (this.isSelected item=item)}} + + {{/if}} +
+ {{else}} + + {{/if}} {{/if}} diff --git a/packages/oss-components/src/components/o-s-s/select.stories.gts b/packages/oss-components/src/components/o-s-s/select.stories.gts index e4230dd99..abaa652a5 100644 --- a/packages/oss-components/src/components/o-s-s/select.stories.gts +++ b/packages/oss-components/src/components/o-s-s/select.stories.gts @@ -94,6 +94,17 @@ export default { }, control: { type: 'text' } }, + valueKey: { + description: + 'The attribute used to compare the current value with the items. Without it, the comparison is done by reference.', + table: { + type: { + summary: 'string' + }, + defaultValue: { summary: 'undefined' } + }, + control: { type: 'text' } + }, placeholder: { description: 'Placeholder', table: { @@ -297,6 +308,32 @@ const WithEmptyStateNamedBlockTemplate = (args) => ({ context: args }); +const WithRowNamedBlockTemplate = (args) => ({ + template: hbs` +
+ + <:row as |item Option|> + +
+ `, + context: args +}); + +const WithoutOptionBlockTemplate = (args) => ({ + template: hbs` +
+ +
+ `, + context: args +}); + export const Default = {}; export const SmartSkin = { @@ -310,3 +347,19 @@ export const WithSelectedNamedBlock = { export const WithEmptyStateNamedBlock = { render: WithEmptyStateNamedBlockTemplate }; + +export const WithRowNamedBlock = { + render: WithRowNamedBlockTemplate +}; + +export const WithoutOptionBlock = { + render: WithoutOptionBlockTemplate +}; + +export const WithValueKey = { + render: WithoutOptionBlockTemplate, + args: { + value: { ...FAKE_DATA[1] }, + valueKey: 'name' + } +}; diff --git a/packages/oss-components/src/components/o-s-s/select.ts b/packages/oss-components/src/components/o-s-s/select.ts index df1ef9ccc..dde2a88fe 100644 --- a/packages/oss-components/src/components/o-s-s/select.ts +++ b/packages/oss-components/src/components/o-s-s/select.ts @@ -1,5 +1,6 @@ +import { helper } from '@ember/component/helper'; import { assert } from '@ember/debug'; -import { action } from '@ember/object'; +import { action, get } from '@ember/object'; import type Owner from '@ember/owner'; import { scheduleOnce } from '@ember/runloop'; import { service } from '@ember/service'; @@ -16,6 +17,7 @@ interface OSSSelectArgs extends BaseDropdownArgs { value: any; items: any[]; targetLabel?: string; + valueKey?: string; placeholder?: string; disabled?: boolean; errorMessage?: string; @@ -37,6 +39,17 @@ export default class OSSSelect extends BaseDropdown { cleanupDrodpownAutoplacement?: () => void; + isSelected = helper((_, { item }: { item: any }): boolean => { + const { value, valueKey } = this.args; + + if (value === undefined || value === null) return false; + if (!valueKey) return item === value; + + const currentKey = get(value, valueKey); + + return currentKey !== undefined && currentKey !== null && get(item, valueKey) === currentKey; + }); + constructor(owner: Owner, args: OSSSelectArgs) { super(owner, args); @@ -136,11 +149,6 @@ export default class OSSSelect extends BaseDropdown { this.hideSelector(); } - @action - ensureBlockPresence(hasOptionItem: boolean): void { - assert(`[component][OSS::Select] You must pass option named block`, hasOptionItem); - } - @action onActionClick(event: PointerEvent): void { this.args.action?.onClick(event); diff --git a/packages/oss-components/styles/power-select.less b/packages/oss-components/styles/power-select.less index db4850acd..555fa28ee 100644 --- a/packages/oss-components/styles/power-select.less +++ b/packages/oss-components/styles/power-select.less @@ -16,6 +16,10 @@ } } + &--disabled .upf-power-select__array-container { + cursor: not-allowed; + } + &--borderless { .array-input-container { border-color: transparent; diff --git a/packages/test-app/tests/integration/components/o-s-s/infinite-select-test.js b/packages/test-app/tests/integration/components/o-s-s/infinite-select-test.js index 835ba436e..2c3b05afc 100644 --- a/packages/test-app/tests/integration/components/o-s-s/infinite-select-test.js +++ b/packages/test-app/tests/integration/components/o-s-s/infinite-select-test.js @@ -435,6 +435,25 @@ module('Integration | Component | o-s-s/infinite-select', function (hooks) { assert.ok(this.onSelect.calledOnceWith(FAKE_DATA[0])); }); + test('On keydown Enter it should not select a disabled Option row', async function (assert) { + this.onSelect = sinon.stub(); + this.noop = () => {}; + + await render( + hbs` + <:option as |item index|> + + + ` + ); + + await triggerKeyEvent('.upf-infinite-select__items-container', 'keydown', 'ArrowDown'); + await triggerKeyEvent('.upf-infinite-select__items-container', 'keydown', 'Enter'); + + assert.true(this.onSelect.notCalled); + }); + test('On keydown Enter it should select the focused element in display order when items are grouped', async function (assert) { this.items = FAKE_DATA_GROUPED; this.onSelect = sinon.stub(); diff --git a/packages/test-app/tests/integration/components/o-s-s/power-select-test.ts b/packages/test-app/tests/integration/components/o-s-s/power-select-test.ts index ea3109c1b..37aff75ef 100644 --- a/packages/test-app/tests/integration/components/o-s-s/power-select-test.ts +++ b/packages/test-app/tests/integration/components/o-s-s/power-select-test.ts @@ -1,4 +1,13 @@ -import { render, setupOnerror, findAll, click, typeIn, scrollTo } from '@ember/test-helpers'; +import { + render, + setupOnerror, + findAll, + click, + typeIn, + scrollTo, + triggerKeyEvent, + type TestContext +} from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { setupIntl } from 'ember-intl/test-support'; @@ -436,6 +445,109 @@ module('Integration | Component | o-s-s/power-select', function (hooks) { }); }); + module('with the row named block', (hooks) => { + hooks.beforeEach(function (this: TestContext) { + this.items = ['first', 'second', 'third']; + this.selectedItems = ['second']; + this.onChangeStub = sinon.stub(); + }); + + test('it renders each item as a multiple selection Option row', async function (this: TestContext, assert) { + await renderPowerSelectWithRow(); + + await click('.upf-power-select__array-container'); + + assert + .infiniteSelectOption('.upf-infinite-select__item:first-child .oss-infinite-select-option') + .hasTitle('first'); + assert + .infiniteSelectOption('.upf-infinite-select__item:first-child .oss-infinite-select-option') + .hasSelectionType('multiple'); + }); + + test('it checks the rows of the selected items', async function (this: TestContext, assert) { + await renderPowerSelectWithRow(); + + await click('.upf-power-select__array-container'); + + assert.infiniteSelectOption('.upf-infinite-select__item:first-child .oss-infinite-select-option').isNotSelected(); + assert.infiniteSelectOption('.upf-infinite-select__item:nth-child(2) .oss-infinite-select-option').isSelected(); + }); + + test('the selected state can be overridden by the consumer', async function (this: TestContext, assert) { + await render(hbs` + + <:selected-item as |selectedItem|> + {{selectedItem}} + + <:row as |item Option|> + + `); + + await click('.upf-power-select__array-container'); + + assert.infiniteSelectOption('.upf-infinite-select__item:first-child .oss-infinite-select-option').isSelected(); + }); + + test('a click on a row calls onChange with the selection operation', async function (this: TestContext, assert) { + await renderPowerSelectWithRow(); + + await click('.upf-power-select__array-container'); + await click('.upf-infinite-select__item:first-child .oss-infinite-select-option'); + + assert.true(this.onChangeStub.calledOnceWithExactly('first', 'selection')); + }); + + test('a click on a row keeps the dropdown open', async function (this: TestContext, assert) { + await renderPowerSelectWithRow(); + + await click('.upf-power-select__array-container'); + await click('.upf-infinite-select__item:first-child .oss-infinite-select-option'); + + assert.dom('.upf-power-select__dropdown').exists(); + }); + + test('Enter on the focused row calls onChange with the selection operation', async function (this: TestContext, assert) { + await renderPowerSelectWithRow(); + + await click('.upf-power-select__array-container'); + await triggerKeyEvent('.upf-power-select__dropdown .upf-input', 'keydown', 'ArrowDown'); + await triggerKeyEvent('.upf-infinite-select__items-container', 'keydown', 'Enter'); + + assert.true(this.onChangeStub.calledOnceWithExactly('first', 'selection')); + }); + + test('Enter on the focused row keeps the dropdown open', async function (this: TestContext, assert) { + await renderPowerSelectWithRow(); + + await click('.upf-power-select__array-container'); + await triggerKeyEvent('.upf-power-select__dropdown .upf-input', 'keydown', 'ArrowDown'); + await triggerKeyEvent('.upf-infinite-select__items-container', 'keydown', 'Enter'); + + assert.dom('.upf-power-select__dropdown').exists(); + }); + }); + + module('with @disabled', () => { + test('it renders the disabled state', async function (this: TestContext, assert) { + await renderDisabledPowerSelect(); + + assert.dom('.upf-power-select .array-input-container').hasClass('array-input-container--disabled'); + }); + + test('the dropdown cannot be opened', async function (this: TestContext, assert) { + await renderDisabledPowerSelect(); + + await click('.upf-power-select__array-container'); + + assert.dom('.upf-power-select').hasNoAttribute('open'); + assert.dom('.upf-power-select__dropdown').doesNotExist(); + }); + }); + module('Error management', () => { test('without selected-item named block', async function (assert) { assert.expect(1); @@ -456,7 +568,7 @@ module('Integration | Component | o-s-s/power-select', function (hooks) { setupOnerror((err: any) => { assert.strictEqual( err.message, - 'Assertion Failed: [component][OSS::PowerSelect] You must pass option-item named block' + 'Assertion Failed: [component][OSS::PowerSelect] You must pass option-item or row named block' ); }); @@ -469,4 +581,32 @@ module('Integration | Component | o-s-s/power-select', function (hooks) { `); }); }); + + async function renderPowerSelectWithRow(): Promise { + await render(hbs` + + <:selected-item as |selectedItem|> + {{selectedItem}} + + <:row as |item Option|> + + `); + } + + async function renderDisabledPowerSelect(): Promise { + await render(hbs` + + <:selected-item as |selectedItem|> + {{selectedItem}} + + <:option-item as |item|> + {{item}} + + + `); + } }); diff --git a/packages/test-app/tests/integration/components/o-s-s/select-test.ts b/packages/test-app/tests/integration/components/o-s-s/select-test.ts index 73363da58..a299e4d9c 100644 --- a/packages/test-app/tests/integration/components/o-s-s/select-test.ts +++ b/packages/test-app/tests/integration/components/o-s-s/select-test.ts @@ -1,4 +1,4 @@ -import { click, render, setupOnerror, typeIn } from '@ember/test-helpers'; +import { click, render, setupOnerror, triggerKeyEvent, typeIn, type TestContext } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { setupIntl } from 'ember-intl/test-support'; @@ -569,6 +569,173 @@ module('Integration | Component | o-s-s/select', function (hooks) { }); }); + module('with the row named block', () => { + test('it renders each item as a single selection Option row', async function (this: TestContext, assert) { + await renderSelectWithRow(); + + await click('.upf-input div'); + + assert.infiniteSelectOption('.upf-infinite-select__item:first-child .oss-infinite-select-option').hasTitle('foo'); + assert + .infiniteSelectOption('.upf-infinite-select__item:first-child .oss-infinite-select-option') + .hasSelectionType('single'); + }); + + test('it checks the row of the current value', async function (this: TestContext, assert) { + this.value = this.items[1]; + await renderSelectWithRow(); + + await click('.upf-input div'); + + assert.infiniteSelectOption('.upf-infinite-select__item:first-child .oss-infinite-select-option').isNotSelected(); + assert.infiniteSelectOption('.upf-infinite-select__item:last-child .oss-infinite-select-option').isSelected(); + }); + + test('a click on a row calls onChange with the item', async function (this: TestContext, assert) { + await renderSelectWithRow(); + + await click('.upf-input div'); + await click('.upf-infinite-select__item:last-child .oss-infinite-select-option'); + + assert.true(this.onChange.calledOnceWithExactly(this.items[1])); + }); + + test('a click on a row closes the dropdown', async function (this: TestContext, assert) { + await renderSelectWithRow(); + + await click('.upf-input div'); + await click('.upf-infinite-select__item:last-child .oss-infinite-select-option'); + + assert.dom('.upf-infinite-select').doesNotExist(); + }); + + test('Enter on the focused row calls onChange with the item', async function (this: TestContext, assert) { + await renderSelectWithRow(); + + await click('.upf-input div'); + await triggerKeyEvent('.upf-infinite-select__items-container', 'keydown', 'ArrowDown'); + await triggerKeyEvent('.upf-infinite-select__items-container', 'keydown', 'Enter'); + + assert.true(this.onChange.calledOnceWithExactly(this.items[1])); + }); + + test('Enter on the focused row closes the dropdown', async function (this: TestContext, assert) { + await renderSelectWithRow(); + + await click('.upf-input div'); + await triggerKeyEvent('.upf-infinite-select__items-container', 'keydown', 'ArrowDown'); + await triggerKeyEvent('.upf-infinite-select__items-container', 'keydown', 'Enter'); + + assert.dom('.upf-infinite-select').doesNotExist(); + }); + + test('Enter on a disabled row does not call onChange', async function (this: TestContext, assert) { + await render( + hbs` + + <:row as |item Option|> + + ` + ); + + await click('.upf-input div'); + await triggerKeyEvent('.upf-infinite-select__items-container', 'keydown', 'ArrowDown'); + await triggerKeyEvent('.upf-infinite-select__items-container', 'keydown', 'Enter'); + + assert.true(this.onChange.notCalled); + }); + }); + + module('without option named block', () => { + test('it renders the label of each item in an Option row', async function (this: TestContext, assert) { + await render(hbs``); + + await click('.upf-input div'); + + assert + .infiniteSelectOption('.upf-infinite-select__item:first-child .oss-infinite-select-option') + .hasTitle('First item'); + assert + .infiniteSelectOption('.upf-infinite-select__item:last-child .oss-infinite-select-option') + .hasTitle('Second item'); + }); + + test('it renders a label that is not a string as text', async function (this: TestContext, assert) { + this.items = [{ label: 2024 }, { label: 2025 }]; + await render(hbs``); + + await click('.upf-input div'); + + assert + .infiniteSelectOption('.upf-infinite-select__item:first-child .oss-infinite-select-option') + .hasTitle('2024'); + }); + + test('a click on a row calls onChange with the item', async function (this: TestContext, assert) { + await render(hbs``); + + await click('.upf-input div'); + await click('.upf-infinite-select__item:first-child .oss-infinite-select-option'); + + assert.true(this.onChange.calledOnceWithExactly(this.items[0])); + }); + }); + + module('@valueKey argument', (hooks) => { + hooks.beforeEach(function (this: TestContext) { + this.value = { ...this.items[1] }; + }); + + test('with @valueKey, the current value is checked when it is another object with the same key', async function (this: TestContext, assert) { + await render( + hbs`` + ); + + await click('.upf-input div'); + + assert.infiniteSelectOption('.upf-infinite-select__item:last-child .oss-infinite-select-option').isSelected(); + }); + + test('with @valueKey, no row is checked when the current value does not have the key', async function (this: TestContext, assert) { + this.value = { label: 'Other item' }; + await render( + hbs`` + ); + + await click('.upf-input div'); + + assert.infiniteSelectOption('.upf-infinite-select__item:first-child .oss-infinite-select-option').isNotSelected(); + assert.infiniteSelectOption('.upf-infinite-select__item:last-child .oss-infinite-select-option').isNotSelected(); + }); + + test('without @valueKey, the current value is compared by reference', async function (this: TestContext, assert) { + await render(hbs``); + + await click('.upf-input div'); + + assert.infiniteSelectOption('.upf-infinite-select__item:last-child .oss-infinite-select-option').isNotSelected(); + }); + + test('with @valueKey, the option named block shows the check icon on the current value', async function (this: TestContext, assert) { + await render( + hbs` + + <:option as |item|> + {{item.name}} + + + ` + ); + + await click('.upf-input div'); + + assert.dom('.upf-infinite-select__item:first-child .fa-check').doesNotExist(); + assert.dom('.upf-infinite-select__item:last-child .fa-check').exists(); + }); + }); + module('Error management', function () { test('it throws an error if no @onChange arg is passed', async function (assert) { assert.expect(1); @@ -581,15 +748,6 @@ module('Integration | Component | o-s-s/select', function (hooks) { await renderExpectingError(this, hbs`{{#if this.show}}{{/if}}`); }); - - test('it throws an error if the component is invoked with no option named blocked', async function (assert) { - assert.expect(1); - setupOnerror((err: Error) => { - assert.strictEqual(err.message, 'Assertion Failed: [component][OSS::Select] You must pass option named block'); - }); - - await render(hbs``); - }); }); test('When hasError is true, the error style is applied to the select', async function (assert) { @@ -647,4 +805,16 @@ module('Integration | Component | o-s-s/select', function (hooks) { assert.dom('.upf-infinite-select .foobar').doesNotExist(); }); }); + + async function renderSelectWithRow(): Promise { + await render( + hbs` + + <:row as |item Option|> + + ` + ); + } });