diff --git a/src/List/List.vue b/src/List/List.vue new file mode 100644 index 0000000..b1cab21 --- /dev/null +++ b/src/List/List.vue @@ -0,0 +1,31 @@ + + + diff --git a/src/List/ListItem.vue b/src/List/ListItem.vue new file mode 100644 index 0000000..a39b39c --- /dev/null +++ b/src/List/ListItem.vue @@ -0,0 +1,25 @@ + + + diff --git a/test/specs/List.spec.js b/test/specs/List.spec.js new file mode 100644 index 0000000..2e1de59 --- /dev/null +++ b/test/specs/List.spec.js @@ -0,0 +1,38 @@ +import List from 'src/List/List.vue' +import ListItem from 'src/List/ListItem.vue' +import { + createVM, + dataPropagationTest, + attrTest, +} from '../helpers' + +describe('List', function () { + it('renders an upgraded list', function () { + const vm = createVM(this, h => ( + + Item 1 + Item 2 + + ), { + }) + vm.$refs.list.should.have.class('mdc-list') + vm.$refs.list.should.match('ul') + }) + + it('can render a custom tag', function () { + const vm = createVM(this, h => ( + Hello + )) + vm.$refs.list.should.have.class('mdc-list') + vm.$refs.list.should.match('div') + }) + + it('keeps original tag data', dataPropagationTest(List)) + + describe('attrs', function () { + attrTest(it, 'mdc-list', List, [ + 'dense', + 'two-lines', + ]) + }) +}) diff --git a/test/specs/ListItem.spec.js b/test/specs/ListItem.spec.js new file mode 100644 index 0000000..b8b25cc --- /dev/null +++ b/test/specs/ListItem.spec.js @@ -0,0 +1,18 @@ +import ListItem from 'src/List/ListItem.vue' +import { + createVM, + dataPropagationTest, +} from '../helpers' + +describe('ListItem', function () { + it('renders an upgraded list item', function () { + const vm = createVM(this, ` +Item 1 +`, { + components: { ListItem }, +}) + vm + }) + + it('keeps original tag data', dataPropagationTest(ListItem)) +})