Skip to content

Commit

Permalink
layout unit test files
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 9, 2016
1 parent 35efe4e commit 2021b1f
Show file tree
Hide file tree
Showing 28 changed files with 17 additions and 17 deletions.
File renamed without changes.
File renamed without changes.
34 changes: 17 additions & 17 deletions test/unit/features/global-api/global-assets-api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,7 @@ describe('Global Assets API', () => {
})
})

it('component', () => {
const def = { a: 1 }
Test.component('test', def)
const component = Test.options.components.test
expect(typeof component).toBe('function')
expect(component.super).toBe(Vue)
expect(component.options.a).toBe(1)
expect(component.options.name).toBe('test')
expect(Test.component('test')).toBe(component)
// already extended
Test.component('test2', component)
expect(Test.component('test2')).toBe(component)
// extended registration should not pollute global
expect(Vue.options.components.test).toBeUndefined()
})

describe('Vue.component works', () => {
describe('Vue.component', () => {
it('should register a component', () => {
Vue.component('foo', {
template: '<span>foo</span>'
Expand All @@ -46,4 +30,20 @@ describe('Global Assets API', () => {
expect(vm.$el.innerHTML).toBe('<span>foo</span><span>bar</span>')
})
})

it('component on extended constructor', () => {
const def = { a: 1 }
Test.component('test', def)
const component = Test.options.components.test
expect(typeof component).toBe('function')
expect(component.super).toBe(Vue)
expect(component.options.a).toBe(1)
expect(component.options.name).toBe('test')
expect(Test.component('test')).toBe(component)
// already extended
Test.component('test2', component)
expect(Test.component('test2')).toBe(component)
// extended registration should not pollute global
expect(Vue.options.components.test).toBeUndefined()
})
})
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.

0 comments on commit 2021b1f

Please sign in to comment.