我有一个使用其他组件的组件。但它不起作用,因为第一个组件的测试表明它缺少名为helper
的{{1}}。
在curit-select
中,您可以添加0.10
moduleForComponent`函数,但现在这样做会强制它进入单元测试模式。 (see)
您不需要通过需求依赖:这样做会强制测试进入单位模式。
组件1:
needs to the
组件2:
<div class='change-device-status'>
Status: {{curit-select content=statuses selection=device.status}}
<button class="save-button" {{action 'save'}}>opslaan</button>
</div>
现在我正在尝试为第一个组件编写集成测试:
<select {{action 'change' on='change'}}>
{{#if prompt}}
<option disabled selected={{is-not selection}}>
{{prompt}}
</option>
{{/if}}
{{#each content key="@identity" as |item|}}
<option value="{{read-path item optionValuePath}}"
selected={{is-equal item selection}}>
{{read-path item optionLabelPath}}
</option>
{{/each}}
</select>
答案 0 :(得分:1)
它会起作用!请记住重新启动ember serve
。