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'
// 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']
}
<template>
<div :class="getClasses">
Another component, another test, random probability
</div>
</template>
<script>
export default {
props: {
classModifiers: {
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
import { GET_OBJECTS } from 'services/constants/action-types'
describe('Objects component', () => {
let store
let state
let actions
beforeEach(() => {
actions = {}
actions[GET_OBJECTS] = sinon.stub()
<template>
<div></div>
</template>
<script type="text/javascript">
import { GET_OBJECTS } from 'services/constants/action-types'
export default {
...
data () {