-
Notifications
You must be signed in to change notification settings - Fork 2.1k
refactor: Adapt foundations for class-object adapters #6256
Changes from all commits
9ab51f5
074a61c
b226666
ba40061
30abe58
c0ad50f
89ce243
535d97d
5395e39
1000147
b692a91
2c7ebf2
a334b06
5758257
ca52634
2d79b01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,48 +21,11 @@ | |
* THE SOFTWARE. | ||
*/ | ||
|
||
import {verifyDefaultAdapter} from '../../../testing/helpers/foundation'; | ||
import {setUpFoundationTest} from '../../../testing/helpers/setup'; | ||
import {attributes, cssClasses, SortValue, strings} from '../constants'; | ||
import {MDCDataTableFoundation} from '../foundation'; | ||
|
||
describe('MDCDataTableFoundation', () => { | ||
it('default adapter returns a complete adapter implementation', () => { | ||
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. is removing tests in scope of this PR? Can we remove this tests when we delete default adapters? This may affect code coverage numbers otherwise. 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. @abhiomkar Initially, we removed these tests because we assumed defaultAdapter would no longer be used (since now adapters need to implement the full interface). But another test mocks an adapter using the defaultAdapter, so just to get the tests to pass, @kseamon suggested putting back the defaultAdapter for now (we can delete them in a later PR) 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. @kseamon Can you please confirm if this is what you intended. http://b/165316767 suggests that unit tests will be cleaned up along with defaultAdapter code. 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. Sorry - missed this way back when - yes, we need to keep the default adaptors around until the tests are refactored. The most straightforward thing might be to factor them out into objects that live in the test files. 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. Got it! Moving objects to live in tests SGTM so that the code coverage numbers will be intact. Since ngwattcos@ left Google, do you want to take a stab at it? You can directly send a CL to us (Copybara will automatically merge the PR). Let me know if you've any questions! |
||
verifyDefaultAdapter(MDCDataTableFoundation, [ | ||
'addClass', | ||
'addClassAtRowIndex', | ||
'getAttributeByHeaderCellIndex', | ||
'getHeaderCellCount', | ||
'getHeaderCellElements', | ||
'getRowCount', | ||
'getRowElements', | ||
'getRowIdAtIndex', | ||
'getRowIndexByChildElement', | ||
'getSelectedRowCount', | ||
'getTableContainerHeight', | ||
'getTableHeaderHeight', | ||
'isCheckboxAtRowIndexChecked', | ||
'isHeaderRowCheckboxChecked', | ||
'isRowsSelectable', | ||
'notifyRowSelectionChanged', | ||
'notifySelectedAll', | ||
'notifySortAction', | ||
'notifyUnselectedAll', | ||
'registerHeaderRowCheckbox', | ||
'registerRowCheckboxes', | ||
'removeClass', | ||
'removeClassAtRowIndex', | ||
'removeClassNameByHeaderCellIndex', | ||
'setAttributeAtRowIndex', | ||
'setAttributeByHeaderCellIndex', | ||
'setClassNameByHeaderCellIndex', | ||
'setHeaderRowCheckboxChecked', | ||
'setHeaderRowCheckboxIndeterminate', | ||
'setProgressIndicatorStyles', | ||
'setRowCheckboxCheckedAtIndex', | ||
'setSortStatusLabelByHeaderCellIndex', | ||
]); | ||
}); | ||
|
||
function setupTest() { | ||
const {foundation, mockAdapter} = | ||
|
Uh oh!
There was an error while loading. Please reload this page.