adopted-ember-addons / adopted-ember-addons/ember-paper

paper-autocomplete breaking following tests

Aberta
#729 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
JavaScript
Estrelas
879
Forks
327
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

I have run into a scenario where I am testing the options returned in an paper-autocomplete. If I do not select an option, all the following integration and unit tests fail. I have simplified my code to help illustrate the issue.

Here is the autocomplete from my template.

```EmberScript
{{#paper-autocomplete
triggerClass="cd-autcomplete-selector"
placeholder="Find a location..."
label="Find a location..."
allowClear=true
searchText=(readonly locationSearchText)
onSearchTextChange=(action (mut locationSearchText))
selected=selectedLocation
search=(route-action "search")
searchField="label"
labelPath="label"
loadingMessage="Searching locations..."
noMatchesMessage="We were unable to find that location."
onSelectionChange=(action (mut selectedLocation)) as |location autocomplete|}}
{{paper-autocomplete-highlight searchText=term.searchText flags="i" label=location.label}}
{{else}}
We are unable to find that busienss location!
{{/paper-autocomplete}}
```

Here is my search action:

```javascript
search () {
return [
{ field: 'name', label: 'Marietta' },
{ field: 'name', label: 'Mountville' },
{ field: 'name', label: 'Lancaster' }
]
}
```

Here is my acceptance test:
```javascript
test('autocomplete test', function (assert) {
visit('/autocomplete')

fillIn('.cd-autcomplete-selector input', 'Mar')

andThen(() => {
assert.equal(find('.ember-power-select-option:contains(Marietta)').length, 1, 'Should show Marietta.')
})
})
```

After adding the code 137 tests are failing.

screen shot 2017-06-09 at 3 27 55 pm

I have found a work around for this issue. Which may help you diagnose this issue. By adding a call to selectChoose to select an option. All tests are fixed and pass again.

```javascript
test('autocomplete test', function (assert) {
visit('/autocomplete')

fillIn('.cd-autcomplete-selector input', 'Mar')

andThen(() => {
assert.equal(find('.ember-power-select-option:contains(Marietta)').length, 1, 'Should show Marietta.')

selectChoose('.cd-autcomplete-selector', '.ember-power-select-option:eq(0)')
})
})
```

screen shot 2017-06-09 at 3 16 49 pm

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.