diff --git a/packages/mdc-textfield/foundation.ts b/packages/mdc-textfield/foundation.ts index 01cff4d5057..4b5e48b5082 100644 --- a/packages/mdc-textfield/foundation.ts +++ b/packages/mdc-textfield/foundation.ts @@ -112,7 +112,7 @@ class MDCTextFieldFoundation extends MDCFoundation { * @param adapter * @param foundationMap Map from subcomponent names to their subfoundations. */ - constructor(adapter: MDCTextFieldAdapter, foundationMap: Partial = {}) { + constructor(adapter?: Partial, foundationMap: Partial = {}) { super({...MDCTextFieldFoundation.defaultAdapter, ...adapter}); this.helperText_ = foundationMap.helperText; diff --git a/test/unit/mdc-textfield/mdc-text-field.test.js b/test/unit/mdc-textfield/mdc-text-field.test.js index 543fd12d157..435aa5d0a7b 100644 --- a/test/unit/mdc-textfield/mdc-text-field.test.js +++ b/test/unit/mdc-textfield/mdc-text-field.test.js @@ -30,8 +30,9 @@ import {MDCRipple} from '../../../packages/mdc-ripple/index'; import {MDCLineRipple} from '../../../packages/mdc-line-ripple/index'; import {MDCFloatingLabel} from '../../../packages/mdc-floating-label/index'; import {MDCNotchedOutline} from '../../../packages/mdc-notched-outline/index'; -import {MDCTextField, MDCTextFieldFoundation, MDCTextFieldHelperText, MDCTextFieldCharacterCounter, - MDCTextFieldIcon} from '../../../packages/mdc-textfield/index'; +import { + MDCTextField, MDCTextFieldFoundation, MDCTextFieldHelperText, MDCTextFieldCharacterCounter, MDCTextFieldIcon, +} from '../../../packages/mdc-textfield/index'; import {cssClasses as helperTextCssClasses} from '../../../packages/mdc-textfield/helper-text/constants'; import {cssClasses as characterCounterCssClasses} from '../../../packages/mdc-textfield/character-counter/constants'; @@ -467,9 +468,7 @@ test('#adapter.setLineRippleTransformOrigin calls the setRippleCenter method on function setupMockFoundationTest(root = getFixture()) { const MockFoundationConstructor = td.constructor(MDCTextFieldFoundation); const mockFoundation = new MockFoundationConstructor(); - const component = new MDCTextField( - root, - mockFoundation); + const component = new MDCTextField(root, mockFoundation); return {root, component, mockFoundation}; }