-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Upgrade to Ember 3.4 (x-select v4.0) #224
Conversation
This needs a whole lot of work. We need to remove jquery from everything.
README.md
Outdated
{{/x-select}} | ||
<XSelect @value={{bob}} action={{action "selectPerson"}} as |xs|> | ||
<xs.option @value={{fred}}}}Fred Flintstone</xs.option> | ||
<xs.option @value={{bob}}}}Bob Newhart</xs.option> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there are some left over }
instead of >
in this file
7940e5c
to
13bbf5f
Compare
README.md
Outdated
`<XSelect>` 4.0 ships with an entirely new test helper that goes | ||
beyond just allowing you to select an option. It allows you to | ||
interact with your `<select>` element in all different ways. For | ||
example in tests if you need to assert your first options `disabled` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example,
(comma)
assert that your first option is
README.md
Outdated
|
||
``` javascript | ||
import { select } from "yourappname/tests/helpers/x-select"; | ||
// you can name the import whatever you want | ||
import XSelect from "yourappname/tests/helpers/x-select"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for the sake of the rest of the examples here, I think it should be XSelectInteractor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hahah that's funny, I was trying to hand wave over the fact that we're using an interactor and make it just about the helper. But I agree, there's no escaping it really.
// ... | ||
|
||
test('Selecting an option', async (assert) => { | ||
await xselect.select('Fred Flintstone'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to mention leaving a quick comment that says something like "the interactor resolves after interacting with the select, but not after any change events are handled" which is why we use when
for the following assertion.
But then that made me think that people will pretty much require when
whenever they use this test helper. Or we can override the default select
method to resolve after it is selected. It would still throw an error when it cannot select or when the option does not get selected, and it would mean people can expect
as usual after awaiting on select(option)
.
08f6630
to
9adf6eb
Compare
Nice work @Robdel12 🎉 I have one suggestion, and one question. Both are related to the fact that we're introducing breaking changes.
<XSelect @over={items} as |Option item|>
<Option>{item.name}</Option>
</XSelect> Or should that be a v5 thing? I'm just mentioning it now since we're breaking things. |
🤔
|
9adf6eb
to
31f315d
Compare
This uncovered some bugs and also more refactoring is needed
`tabindex` does not need to be set to 0 from the ember component since that's its default in the DOM. Only apply the attribute when it's different than 0.
That addon was a premature abstraction. No need for it to live in a different project entirely.
Looks like the service is now dead
31f315d
to
404f0b7
Compare
What is this?
Buckle in, because this is a biggin'.
What started as a simple deprecation warning fix (#223) turned into a full blown upgrade. I needed to remove
sendAction
from the component, which would be a breaking change and require a major version bump. Doing a major version bump is a perfect spot to get other breaking changes you need done, so that's what I did here.User facing
Breaking changes
<XSelect>
4.0 has the following breaking changes:@bigtest/interactor
sendAction
.on-change
is now the default action fired (always was under the hood).action
prop ({{#x-select action="myAction"}}
)Non-breaking changes
There are a few changes that are user facing but not breaking changes:
tabindex
is now default tonull
since<select>
s are interactive elements be default. Applyingtabindex="0"
is redundant.is-selected
class to the selectedoption
Non-user facing changes
The non-user facing changes / upgrades to the addon are:
async
/await
)fs-branding
addon. It needed to be upgraded and it's not useful being abstracted (since no other addons are using it)What's the plan after merge?
I'd like to release
4.0.0-beta.x
for the community to try out. If no issues are found in say 3-4 weeks (or longer. Or sooner 🤷♂️), we'll release4.0.0
proper. 🎉TODOs