This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix(radio): remove getNativeControl from adapter #3785
Merged
moog16
merged 5 commits into
master
from
fix/radio/remove-getnativecontrol-from-adapter
Oct 16, 2018
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8269762
fix(radio): remove getNativeControl adapter method
1b0feca
fix(radio): tests
0e352e4
Merge branch 'master' into fix/radio/remove-getnativecontrol-from-ada…
92cb7c7
Merge branch 'master' into fix/radio/remove-getnativecontrol-from-ada…
bd18aef
fix: test desc
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,9 +107,32 @@ test('get ripple returns a MDCRipple instance', () => { | |
assert.isOk(component.ripple instanceof MDCRipple); | ||
}); | ||
|
||
test('#adapter.getNativeControl() returns the native radio element', () => { | ||
test('adapter#addClass adds a class to the root element', () => { | ||
const {root, component} = setupTest(); | ||
assert.equal( | ||
component.getDefaultFoundation().adapter_.getNativeControl(), root.querySelector(NATIVE_CONTROL_SELECTOR) | ||
); | ||
component.getDefaultFoundation().adapter_.addClass('foo'); | ||
assert.isTrue(root.classList.contains('foo')); | ||
}); | ||
|
||
test('adapter#removeClass removes a class from the root element', () => { | ||
const {root, component} = setupTest(); | ||
root.classList.add('foo'); | ||
component.getDefaultFoundation().adapter_.removeClass('foo'); | ||
assert.isFalse(root.classList.contains('foo')); | ||
}); | ||
|
||
test('#adapter.setNativeControlDisabled sets the native control element disabled', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found the wording of this description a little confusing. Maybe rephrase it to: "#adapter.setNativeControlDisabled sets the native control element's disabled property to true" |
||
const {root, component} = setupTest(); | ||
const radio = root.querySelector(NATIVE_CONTROL_SELECTOR); | ||
|
||
component.getDefaultFoundation().adapter_.setNativeControlDisabled(true); | ||
assert.isTrue(radio.disabled); | ||
}); | ||
|
||
test('#adapter.setNativeControlDisabled returns false when checkbox is not disabled', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found the wording of this description a little confusing. Maybe rephrase it to: "#adapter.setNativeControlDisabled sets the native control element's disabled property to false" |
||
const {root, component} = setupTest(); | ||
const radio = root.querySelector(NATIVE_CONTROL_SELECTOR); | ||
radio.disabled = true; | ||
|
||
component.getDefaultFoundation().adapter_.setNativeControlDisabled(false); | ||
assert.isFalse(radio.disabled); | ||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Missing
disabled: boolean
argument.Also update description to something like: