Skip to content

Instantly share code, notes, and snippets.

View bmfteixeira's full-sized avatar

Bruno Teixeira bmfteixeira

View GitHub Profile
import Obj from '../Obj.vue'
describe('Obj', () => {
describe('Lifecycle', () => {
it('created', done => {
const context = {
getInitialConfig: () => {}
}
const getInitialConfigSpy = sinon.spy(context, 'getInitialConfigSpy')
<template>
<div>
Lifecycle using object example
</div>
</template>
<script>
import { mapActions } from 'vuex'
import { actionTypes } from 'services/constants'
<template>
<div :class="getClasses">
Another component, another test, random probability
</div>
</template>
<script>
export default {
props: {
classModifiers: {
// Working with the object here!
import Probability from '../probability.vue'
describe('Probability component', () => {
describe('Computed ', () => {
it('getClasses', done => {
const context = {
classModifiers: ['medium', 'blue-theme', 'rounded-corners']
}
import { GET_OBJECTS } from 'services/constants/action-types'
describe('Objects component', () => {
let store
let state
let actions
beforeEach(() => {
actions = {}
actions[GET_OBJECTS] = sinon.stub()
describe('Objects component', () => {
describe('Methods', () => {
it('getObjects - should return true and set the data.currentObjects if getObjects retrieves an array of objects', done => {
const mockedObjects = [
{ id: 1 },
{ id: 2 }
]
const wrapper = mount(ObjectsComponent)
const getObjectsStub = sinon.stub(wrapper.vm, 'getObjects').returns(mockedObjects)
describe('Computed component', () => {
let props
beforeEach(() => {
props = {
plan: 'pro'
}
})
describe('Computed', () => {
<template>
<div :class="themeDiv"></div>
</template>
<script type="text/javascript">
export default {
props: {
plan: {
required: true,
type: String
describe('Watcher component', () => {
let props
beforeEach(() => {
props = {
propId: 1
}
})
describe('Watcher', () => {
<template>
<div></div>
</template>
<script type="text/javascript">
export default {
props: {
propId: {
type: Number,
required: true