[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

at conflicts with default count #641

Closed
marcandre opened this issue Oct 7, 2021 · 0 comments · Fixed by #642
Closed

at conflicts with default count #641

marcandre opened this issue Oct 7, 2021 · 0 comments · Fixed by #642

Comments

@marcandre
Copy link
Contributor

Calling Query.at currently almost never makes sense without having to specify count :any or some minimum/maximum value.

E.g.:

query = Query.css(".some-class", at: 2)
find(page, query) # => "Expected to find 1 visible element that matched the css '.some-class' but 6 visible elements were found."

I feel the query above clearly intends count: :any / nil and it would be better if it
wasn't mandatory to specify it.

marcandre added a commit to marcandre/wallaby that referenced this issue Oct 7, 2021
This is achieved with a lazy default for `conditions[:count]`.
The function `Query.count/1` must now be used to get the effective count condition.

Alternative would have been to continue setting `count` to a
non `nil` default when conditions are first built. This has the inconvenient
of not being to distinguish a count set by default from an explicit one (i.e.
`Query.css(".x") |> Query.at(0)` from `Query.css(".x", count: 1) |> Query.at(0)`)

[Fixes elixir-wallaby#641]
marcandre added a commit to marcandre/wallaby that referenced this issue Oct 7, 2021
This is achieved with a lazy default for `conditions[:count]`.
The function `Query.count/1` must now be used to get the effective count condition.

Alternative would have been to continue setting `count` to a
non `nil` default when conditions are first built. This has the inconvenient
of not being to distinguish a count set by default from an explicit one (i.e.
`Query.css(".x") |> Query.at(0)` from `Query.css(".x", count: 1) |> Query.at(0)`)

[Fixes elixir-wallaby#641]
marcandre added a commit to marcandre/wallaby that referenced this issue Oct 7, 2021
This is achieved with a lazy default for `conditions[:count]`.
The function `Query.count/1` must now be used to get the effective count condition.

Alternative would have been to continue setting `count` to a
non `nil` default when conditions are first built. This has the inconvenient
of not being to distinguish a count set by default from an explicit one (i.e.
`Query.css(".x") |> Query.at(0)` from `Query.css(".x", count: 1) |> Query.at(0)`)

[Fixes elixir-wallaby#641]
mhanberg pushed a commit to marcandre/wallaby that referenced this issue Oct 20, 2021
This is achieved with a lazy default for `conditions[:count]`.
The function `Query.count/1` must now be used to get the effective count condition.

Alternative would have been to continue setting `count` to a
non `nil` default when conditions are first built. This has the inconvenient
of not being to distinguish a count set by default from an explicit one (i.e.
`Query.css(".x") |> Query.at(0)` from `Query.css(".x", count: 1) |> Query.at(0)`)

[Fixes elixir-wallaby#641]
marcandre added a commit to marcandre/wallaby that referenced this issue Oct 24, 2021
This is achieved with a lazy default for `conditions[:count]`.
The function `Query.count/1` must now be used to get the effective count condition.

Alternative would have been to continue setting `count` to a
non `nil` default when conditions are first built. This has the inconvenient
of not being to distinguish a count set by default from an explicit one (i.e.
`Query.css(".x") |> Query.at(0)` from `Query.css(".x", count: 1) |> Query.at(0)`)

[Fixes elixir-wallaby#641]
marcandre added a commit to marcandre/wallaby that referenced this issue Oct 25, 2021
This is achieved with a lazy default for `conditions[:count]`.
The function `Query.count/1` must now be used to get the effective count condition.

Alternative would have been to continue setting `count` to a
non `nil` default when conditions are first built. This has the inconvenient
of not being to distinguish a count set by default from an explicit one (i.e.
`Query.css(".x") |> Query.at(0)` from `Query.css(".x", count: 1) |> Query.at(0)`)

[Fixes elixir-wallaby#641]
marcandre added a commit to marcandre/wallaby that referenced this issue Oct 25, 2021
This is achieved with a lazy default for `conditions[:count]`.
The function `Query.count/1` must now be used to get the effective count condition.

Alternative would have been to continue setting `count` to a
non `nil` default when conditions are first built. This has the inconvenient
of not being to distinguish a count set by default from an explicit one (i.e.
`Query.css(".x") |> Query.at(0)` from `Query.css(".x", count: 1) |> Query.at(0)`)

[Fixes elixir-wallaby#641]
marcandre added a commit to marcandre/wallaby that referenced this issue Oct 25, 2021
This is achieved with a lazy default for `conditions[:count]`.
The function `Query.count/1` must now be used to get the effective count condition.

Alternative would have been to continue setting `count` to a
non `nil` default when conditions are first built. This has the inconvenient
of not being to distinguish a count set by default from an explicit one (i.e.
`Query.css(".x") |> Query.at(0)` from `Query.css(".x", count: 1) |> Query.at(0)`)

[Fixes elixir-wallaby#641]
marcandre added a commit to marcandre/wallaby that referenced this issue Oct 25, 2021
This is achieved with a lazy default for `conditions[:count]`.
The function `Query.count/1` must now be used to get the effective count condition.

Alternative would have been to continue setting `count` to a
non `nil` default when conditions are first built. This has the inconvenient
of not being to distinguish a count set by default from an explicit one (i.e.
`Query.css(".x") |> Query.at(0)` from `Query.css(".x", count: 1) |> Query.at(0)`)

[Fixes elixir-wallaby#641]
mhanberg pushed a commit to marcandre/wallaby that referenced this issue May 7, 2022
This is achieved with a lazy default for `conditions[:count]`.
The function `Query.count/1` must now be used to get the effective count condition.

Alternative would have been to continue setting `count` to a
non `nil` default when conditions are first built. This has the inconvenient
of not being to distinguish a count set by default from an explicit one (i.e.
`Query.css(".x") |> Query.at(0)` from `Query.css(".x", count: 1) |> Query.at(0)`)

[Fixes elixir-wallaby#641]
mhanberg pushed a commit that referenced this issue May 7, 2022
This is achieved with a lazy default for `conditions[:count]`.
The function `Query.count/1` must now be used to get the effective count condition.

Alternative would have been to continue setting `count` to a
non `nil` default when conditions are first built. This has the inconvenient
of not being to distinguish a count set by default from an explicit one (i.e.
`Query.css(".x") |> Query.at(0)` from `Query.css(".x", count: 1) |> Query.at(0)`)

Fixes #641
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant