feat: copy features from pro template

This commit is contained in:
woothu
2020-02-24 16:42:33 +01:00
parent c68263b85f
commit 7e9d384af2
21 changed files with 1511 additions and 1658 deletions
@@ -6,8 +6,8 @@ exports[`TheContainer.vue renders correctly 1`] = `
>
<thesidebar-stub />
<div
class="c-wrapper c-fixed-components"
<cwrapper-stub
tag="div"
>
<theheader-stub />
@@ -29,6 +29,6 @@ exports[`TheContainer.vue renders correctly 1`] = `
<thefooter-stub />
</div>
</div>
</cwrapper-stub>
</div>
`;
@@ -100,6 +100,32 @@ exports[`Collapses.vue renders correctly 1`] = `
</div>
</div>
</div>
<div
class="card"
>
<header
class="card-header"
>
<strong>
Collapsible card
</strong>
</header>
<div
class="card-body"
>
<div
class="mt-2"
>
<p
class="card-text"
>
Collapse contents Here
</p>
</div>
</div>
</div>
</div>
</div>
`;
@@ -9,9 +9,13 @@ exports[`Paginations.vue renders correctly 1`] = `
/>
<strong>
Responsive bootstrap Pagination
Pagination
</strong>
<small>
size
</small>
<div
class="card-header-actions"
>
@@ -65,7 +69,9 @@ exports[`Paginations.vue renders correctly 1`] = `
<br />
<div>
<div
class="d-md-down-none"
>
<h6>
Large
</h6>
@@ -2,16 +2,14 @@
exports[`Login.vue renders correctly 1`] = `
<ccontainer-stub
class="d-flex align-items-center min-vh-100"
class="d-flex content-center min-vh-100"
tag="div"
>
<crow-stub
class="justify-content-center"
gutters="true"
tag="div"
>
<ccol-stub
md="8"
tag="div"
>
<ccardgroup-stub
@@ -51,6 +49,7 @@ exports[`Login.vue renders correctly 1`] = `
tag="div"
>
<ccol-stub
class="text-left"
col="6"
tag="div"
>
@@ -85,6 +84,19 @@ exports[`Login.vue renders correctly 1`] = `
>
Forgot password?
</cbutton-stub>
<cbutton-stub
activeclass="router-link-active"
class="d-md-none"
color="link"
event="click"
exactactiveclass="router-link-exact-active"
routertag="a"
target="_self"
type="button"
>
Register now!
</cbutton-stub>
</ccol-stub>
</crow-stub>
</cform-stub>
@@ -93,7 +105,7 @@ exports[`Login.vue renders correctly 1`] = `
<ccard-stub
bodywrapper="true"
class="text-center py-5 d-md-down-none"
class="text-center py-5 d-sm-down-none"
color="primary"
textcolor="white"
>
@@ -1,132 +1,135 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Register.vue renders correctly 1`] = `
<ccontainer-stub
class="min-vh-100 d-flex align-items-center"
tag="div"
<div
class="d-flex align-items-center min-vh-100"
>
<crow-stub
class="w-100 justify-content-center"
gutters="true"
<ccontainer-stub
fluid="true"
tag="div"
>
<ccol-stub
md="6"
sm="8"
<crow-stub
class="justify-content-center"
gutters="true"
tag="div"
>
<ccard-stub
class="mx-4 mb-0"
<ccol-stub
md="6"
tag="div"
>
<ccardbody-stub
class="p-4"
<ccard-stub
class="mx-4 mb-0"
>
<cform-stub>
<h1>
Register
</h1>
<p
class="text-muted"
>
Create your account
</p>
<cinput-stub
autocomplete="username"
lazy="400"
placeholder="Username"
type="text"
/>
<cinput-stub
autocomplete="email"
lazy="400"
placeholder="Email"
prepend="@"
type="text"
/>
<cinput-stub
autocomplete="new-password"
lazy="400"
placeholder="Password"
type="password"
/>
<cinput-stub
autocomplete="new-password"
class="mb-4"
lazy="400"
placeholder="Repeat password"
type="password"
/>
<cbutton-stub
activeclass="router-link-active"
block="true"
color="success"
event="click"
exactactiveclass="router-link-exact-active"
routertag="a"
target="_self"
type="button"
>
Create Account
</cbutton-stub>
</cform-stub>
</ccardbody-stub>
<ccardfooter-stub
class="p-4"
>
<crow-stub
gutters="true"
tag="div"
<ccardbody-stub
class="p-4"
>
<ccol-stub
col="6"
tag="div"
>
<cform-stub>
<h1>
Register
</h1>
<p
class="text-muted"
>
Create your account
</p>
<cinput-stub
autocomplete="username"
lazy="400"
placeholder="Username"
type="text"
/>
<cinput-stub
autocomplete="email"
lazy="400"
placeholder="Email"
prepend="@"
type="text"
/>
<cinput-stub
autocomplete="new-password"
lazy="400"
placeholder="Password"
type="password"
/>
<cinput-stub
autocomplete="new-password"
class="mb-4"
lazy="400"
placeholder="Repeat password"
type="password"
/>
<cbutton-stub
activeclass="router-link-active"
block="true"
color="facebook"
color="success"
event="click"
exactactiveclass="router-link-exact-active"
routertag="a"
target="_self"
type="button"
>
Facebook
Create Account
</cbutton-stub>
</ccol-stub>
<ccol-stub
col="6"
</cform-stub>
</ccardbody-stub>
<ccardfooter-stub
class="p-4"
>
<crow-stub
gutters="true"
tag="div"
>
<cbutton-stub
activeclass="router-link-active"
block="true"
color="twitter"
event="click"
exactactiveclass="router-link-exact-active"
routertag="a"
target="_self"
type="button"
<ccol-stub
col="6"
tag="div"
>
<cbutton-stub
activeclass="router-link-active"
block="true"
color="facebook"
event="click"
exactactiveclass="router-link-exact-active"
routertag="a"
target="_self"
type="button"
>
Facebook
Twitter
</cbutton-stub>
</ccol-stub>
</crow-stub>
</ccardfooter-stub>
</ccard-stub>
</ccol-stub>
</crow-stub>
</ccontainer-stub>
</cbutton-stub>
</ccol-stub>
<ccol-stub
col="6"
tag="div"
>
<cbutton-stub
activeclass="router-link-active"
block="true"
color="twitter"
event="click"
exactactiveclass="router-link-exact-active"
routertag="a"
target="_self"
type="button"
>
Twitter
</cbutton-stub>
</ccol-stub>
</crow-stub>
</ccardfooter-stub>
</ccard-stub>
</ccol-stub>
</crow-stub>
</ccontainer-stub>
</div>
`;
+12 -21
View File
@@ -1,46 +1,37 @@
import { shallowMount, createLocalVue } from '@vue/test-utils'
import { mount, createLocalVue } from '@vue/test-utils'
import VueRouter from 'vue-router'
import CoreuiVue from '@coreui/vue'
import User from '@/views/users/User'
import appRouter from '@/router'
const localVue = createLocalVue()
localVue.use(VueRouter)
const router = new VueRouter()
const router = appRouter
router.push({path: '/users/1'})
localVue.use(CoreuiVue)
describe('User.vue', () => {
let wrapper
beforeEach(() => {
wrapper = mount(User, {
localVue,
router
})
})
it('has a name', () => {
expect(User.name).toBe('User')
})
it('is Vue instance', () => {
const wrapper = shallowMount(User, {
localVue,
router
})
expect(wrapper.isVueInstance()).toBe(true)
})
it('is User', () => {
const wrapper = shallowMount(User, {
localVue,
router
})
expect(wrapper.is(User)).toBe(true)
})
it('should have methods', () => {
const wrapper = shallowMount(User,{
localVue,
router
})
expect(typeof User.methods.goBack ).toEqual('function')
expect(wrapper.vm.goBack()).toBeUndefined()
expect(typeof User.methods.goBack).toEqual('function')
})
test('renders correctly', () => {
const wrapper = shallowMount(User, {
localVue,
router
})
expect(wrapper.element).toMatchSnapshot()
})
})
-11
View File
@@ -37,15 +37,4 @@ describe('Users.vue', () => {
})
expect(wrapper.element).toMatchSnapshot()
})
it('should have methods', () => {
const wrapper = shallowMount(Users,{
localVue,
router
})
expect(typeof Users.methods.userLink ).toEqual('function')
expect(Users.methods.userLink(42)).toBe('users/42')
expect(typeof Users.methods.rowClicked ).toEqual('function')
expect(wrapper.vm.rowClicked({id:42})).toBeUndefined()
})
})
@@ -1,50 +1,150 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`User.vue renders correctly 1`] = `
<crow-stub
gutters="true"
tag="div"
<div
class="row"
>
<ccol-stub
col="12"
lg="6"
tag="div"
<div
class="col-12 col-lg-6"
>
<ccard-stub>
<ccardheader-stub>
<div
class="card"
>
<header
class="card-header"
>
User id:
User id: 1
</ccardheader-stub>
</header>
<ccardbody-stub>
<cdatatable-stub
fields="[object Object],[object Object]"
fixed="true"
header="true"
items="[object Object]"
itemsperpage="10"
responsive="true"
<div
class="card-body"
>
<div
data-v-31168812=""
small=""
sortervalue="[object Object]"
striped="true"
/>
</ccardbody-stub>
>
<!---->
<div
class="position-relative table-responsive"
data-v-31168812=""
>
<table
class="table table-striped b-table-fixed"
data-v-31168812=""
>
<thead
data-v-31168812=""
>
<tr
data-v-31168812=""
>
<th
class=""
data-v-31168812=""
style="width: 150px;"
>
<div
class="d-inline"
data-v-31168812=""
>
Samppa Nori
</div>
<!---->
</th>
<th
class=""
data-v-31168812=""
style="width: 150px;"
>
<div
class="d-inline"
data-v-31168812=""
>
</div>
<!---->
</th>
</tr>
<!---->
</thead>
<tbody
class="position-relative"
data-v-31168812=""
>
<tr
data-v-31168812=""
>
<td
class=""
data-v-31168812=""
>
registered
</td>
<td
class=""
data-v-31168812=""
>
2012/01/01
</td>
</tr>
<!---->
<tr
data-v-31168812=""
>
<td
class=""
data-v-31168812=""
>
role
</td>
<td
class=""
data-v-31168812=""
>
Member
</td>
</tr>
<!---->
<tr
data-v-31168812=""
>
<td
class=""
data-v-31168812=""
>
status
</td>
<td
class=""
data-v-31168812=""
>
Active
</td>
</tr>
<!---->
<!---->
</tbody>
<!---->
</table>
<!---->
</div>
<!---->
</div>
</div>
<ccardfooter-stub>
<cbutton-stub
activeclass="router-link-active"
color="primary"
event="click"
exactactiveclass="router-link-exact-active"
routertag="a"
target="_self"
<footer
class="card-footer"
>
<button
class="btn btn-primary"
type="button"
>
Back
</cbutton-stub>
</ccardfooter-stub>
</ccard-stub>
</ccol-stub>
</crow-stub>
</button>
</footer>
</div>
</div>
</div>
`;
@@ -21,18 +21,26 @@ exports[`Users.vue renders correctly 1`] = `
<ccardbody-stub>
<cdatatable-stub
activepage="1"
clickablerows="true"
fields="[object Object],[object Object],[object Object],[object Object]"
header="true"
hover="true"
index-column=""
items="[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]"
itemsperpage="5"
pagination="[object Object]"
responsive="true"
sortervalue="[object Object]"
striped="true"
/>
<cpagination-stub
activepage="1"
align="center"
arrows="true"
dots="true"
limit="5"
pages="5"
/>
</ccardbody-stub>
</ccard-stub>
</ccol-stub>