adopted-ember-addons / adopted-ember-addons/ember-sortable
The reorder test helper does not work correctly when a direction is explicitly set
- 主要语言
- TypeScript
- 星标
- 299
- 派生
- 159
- 平均合并
- 4 天 6 小时
- 30 天内合并 PR
- 4
描述
**Describe the bug**
The reorder test helper does not work correctly when a direction is explicitly set.
**To Reproduce**
Steps to reproduce the behavior:
1. Use `{{sortable-group groupName="closableTabs" direction='x' onChange=@onReorder}}` on a List Element2.
2. Use the reorder helper in the test file
**Expected behavior**
The new order of the items in the list is the one provided to the reorder helper.
**Additional context**
#### The Template File
```hbs
-
...
```#### Inside the test logic
```ts
import { reorder } from 'ember-sortable/test-support/helpers';...
await reorder(
'mouse',
'[data-test-tabs]',
`[data-test-id="${explorations[1].explorationId}"]`,
`[data-test-id="${explorations[0].explorationId}"]`,
`[data-test-id="${explorations[3].explorationId}"]`,
`[data-test-id="${explorations[2].explorationId}"]`
);
```**Workaround**
```ts
get direction() {
if (ENV.environment === 'test') {
return;
}
return 'x';
}
``````diff
+ {{sortable-group groupName="closableTabs" direction=this.direction onChange=@onReorder}}
- {{sortable-group groupName="closableTabs" direction='x' onChange=@onReorder}}
```
{{#each @views as |exploration|}}
贡献指南
评估
这个 Issue 还没有评估数据。