fix: template fixes, updates and refactors

This commit is contained in:
woothu
2019-10-25 18:32:56 +02:00
parent 4f43f966a9
commit e670826803
19 changed files with 106 additions and 79 deletions
@@ -7,6 +7,7 @@ exports[`TheFooter.vue renders correctly 1`] = `
<div>
<a
href="https://coreui.io"
target="_blank"
>
CoreUI
</a>
@@ -28,7 +29,8 @@ exports[`TheFooter.vue renders correctly 1`] = `
</span>
<a
href="https://coreui.io"
href="https://coreui.io/vue"
target="_blank"
>
CoreUI for Vue
</a>
@@ -9,23 +9,24 @@ exports[`TheHeader.vue renders correctly 1`] = `
withsubheader="true"
>
<ctoggler-stub
class="c-header-toggler ml-3 d-lg-none"
class="ml-3 d-lg-none"
inheader="true"
tag="button"
/>
<ctoggler-stub
class="c-header-toggler ml-3 d-md-down-none"
class="ml-3 d-md-down-none"
inheader="true"
tag="button"
/>
<img
<cheaderbrand
alt="CoreUI Logo"
class="c-header-brand mx-auto d-lg-none"
class="mx-auto d-lg-none"
height="46"
src="img/brand/coreui-base.svg"
width="97"
wrappedinlink="[object Object]"
/>
<cheadernav-stub
@@ -119,12 +120,12 @@ exports[`TheHeader.vue renders correctly 1`] = `
<theheaderdropdownaccnt-stub />
</cheadernav-stub>
<div
class="c-subheader px-3"
<csubheader
class="px-3"
>
<cbreadcrumbrouter-stub
class="border-0"
/>
</div>
</csubheader>
</cheader-stub>
`;
@@ -10,8 +10,8 @@ exports[`TheSidebar.vue renders correctly 1`] = `
show="responsive"
>
<csidebarbrand-stub
fullsrc="img/brand/coreui-base-white.svg"
minimizedsrc="img/brand/coreui-signet-white.svg"
imgfull="[object Object]"
imgminimized="[object Object]"
wrappedinlink="[object Object]"
/>
-16
View File
@@ -9,26 +9,10 @@ describe('Collapses.vue', () => {
it('has a name', () => {
expect(Collapses.name).toBe('Collapses')
})
it('has a created hook', () => {
expect(typeof Collapses.data).toMatch('function')
})
it('sets the correct default data', () => {
expect(typeof Collapses.data).toMatch('function')
const defaultData = Collapses.data()
expect(defaultData.showCollapse).toBe(true)
})
it('is Vue instance', () => {
const wrapper = shallowMount(Collapses)
expect(wrapper.isVueInstance()).toBe(true)
})
// it('is Collapses', () => {
// const wrapper = shallowMount(Collapses)
// expect(wrapper.is(Collapses)).toBe(true)
// })
// it('should render correct content', () => {
// const wrapper = mount(Collapses)
// expect(wrapper.find('header.card-header > div > strong').text()).toMatch('Bootstrap Collapse')
// })
test('renders correctly', () => {
const wrapper = mount(Collapses)
expect(wrapper.element).toMatchSnapshot()
@@ -54,7 +54,7 @@ exports[`Breadcrumbs.vue renders correctly 1`] = `
href="#"
target="_self"
>
&lt;b&gt;Admin&lt;/b&gt;
Admin
</a>
</li>
<li
@@ -45,7 +45,6 @@ exports[`Collapses.vue renders correctly 1`] = `
>
<button
class="btn btn-primary"
id="collapse1"
type="button"
>
@@ -56,7 +55,6 @@ exports[`Collapses.vue renders correctly 1`] = `
<div
class="mt-2"
style="display: none;"
toggler="collapse1"
>
<div
class="card"
@@ -73,7 +71,6 @@ exports[`Collapses.vue renders correctly 1`] = `
<button
class="btn btn-secondary btn-sm"
id="collapse2"
type="button"
>
@@ -84,7 +81,6 @@ exports[`Collapses.vue renders correctly 1`] = `
<div
class="mt-2"
style="display: none;"
toggler="collapse2"
>
<div
class="card"
@@ -38,10 +38,20 @@ exports[`Jumbotrons.vue renders correctly 1`] = `
<ccardbody-stub>
<cjumbotron-stub
header="Bootstrap 4"
lead="Bootstrap 4 Components for Vue.js 2"
tag="div"
>
<h1
class="display-3"
>
Bootstrap 4
</h1>
<p
class="lead"
>
Bootstrap 4 Components for Vue.js 2
</p>
<p>
For more information visit website
</p>
@@ -87,9 +97,14 @@ exports[`Jumbotrons.vue renders correctly 1`] = `
lead=""
tag="div"
>
<h1
class="display-3"
>
Bootstrap 4
</h1>
<p
class="lead"
slot="lead"
>
This is a simple hero unit, a simple jumbotron-style component for
@@ -164,13 +179,17 @@ exports[`Jumbotrons.vue renders correctly 1`] = `
<cjumbotron-stub
bordercolor="dark"
color="info"
header="Bootstrap 4"
tag="div"
textcolor="white"
>
<h1
class="display-3"
>
Bootstrap 4
</h1>
<p
class="lead"
slot="lead"
>
This is a simple hero unit, a simple jumbotron-style component for
@@ -286,11 +286,11 @@ exports[`Navbars.vue renders correctly 1`] = `
<cnavbarnav-stub
tag="ul"
>
<span
class="navbar-text"
<cnavbartext-stub
tag="div"
>
Navbar text
</span>
</cnavbartext-stub>
</cnavbarnav-stub>
</ccollapse-stub>
</cnavbar-stub>
@@ -356,7 +356,25 @@ exports[`Alerts.vue renders correctly 1`] = `
class="alert-dismissible"
color="secondary"
show="true"
/>
>
Dismissible Alert with custom button!
<cbutton-stub
activeclass="active"
class="position-absolute"
color="secondary"
event="click"
exactactiveclass="active"
routertag="a"
target="_self"
type="button"
>
Close
</cbutton-stub>
</calert-stub>
<cbutton-stub
activeclass="active"