mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-07 02:28:54 +08:00
update tests
This commit is contained in:
@@ -5,7 +5,7 @@ import TableDescription from '@/views/Main/Workspace/Schema/TableDescription'
|
||||
describe('TableDescription.vue', () => {
|
||||
it('Initially the columns are hidden and table name is rendered', () => {
|
||||
const wrapper = shallowMount(TableDescription, {
|
||||
propsData: {
|
||||
props: {
|
||||
name: 'Test table',
|
||||
columns: [
|
||||
{ name: 'id', type: 'number' },
|
||||
@@ -19,8 +19,10 @@ describe('TableDescription.vue', () => {
|
||||
|
||||
it('Columns are visible and correct when click on table name', async () => {
|
||||
const wrapper = shallowMount(TableDescription, {
|
||||
stubs: ['router-link'],
|
||||
propsData: {
|
||||
global: {
|
||||
stubs: ['router-link']
|
||||
},
|
||||
props: {
|
||||
name: 'Test table',
|
||||
columns: [
|
||||
{ name: 'id', type: 'number' },
|
||||
@@ -32,7 +34,7 @@ describe('TableDescription.vue', () => {
|
||||
|
||||
expect(wrapper.find('.columns').isVisible()).to.equal(true)
|
||||
expect(wrapper.findAll('.column').length).to.equal(2)
|
||||
expect(wrapper.findAll('.column').at(0).text()).to.include('id').and.include('number')
|
||||
expect(wrapper.findAll('.column').at(1).text()).to.include('title').and.include('nvarchar(24)')
|
||||
expect(wrapper.findAll('.column')[0].text()).to.include('id').and.include('number')
|
||||
expect(wrapper.findAll('.column')[1].text()).to.include('title').and.include('nvarchar(24)')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user