mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-07 02:28:54 +08:00
format
This commit is contained in:
@@ -25,8 +25,9 @@ describe('Record.vue', () => {
|
||||
expect(rows[1].findAll('th')[0].text()).to.equals('name')
|
||||
expect(rows[1].findAll('td')[0].text()).to.equals('bar')
|
||||
|
||||
const selectedCell = wrapper
|
||||
.find('.sqliteviz-table tbody td[aria-selected="true"]')
|
||||
const selectedCell = wrapper.find(
|
||||
'.sqliteviz-table tbody td[aria-selected="true"]'
|
||||
)
|
||||
expect(selectedCell.text()).to.equals('bar')
|
||||
})
|
||||
|
||||
@@ -49,8 +50,9 @@ describe('Record.vue', () => {
|
||||
expect(rows).to.have.lengthOf(2)
|
||||
expect(rows[0].findAll('td')[0].text()).to.equals('1')
|
||||
expect(rows[1].findAll('td')[0].text()).to.equals('foo')
|
||||
let selectedCell = wrapper
|
||||
.find('.sqliteviz-table tbody td[aria-selected="true"]')
|
||||
let selectedCell = wrapper.find(
|
||||
'.sqliteviz-table tbody td[aria-selected="true"]'
|
||||
)
|
||||
expect(selectedCell.text()).to.equals('1')
|
||||
|
||||
await wrapper.find('.next').trigger('click')
|
||||
@@ -58,8 +60,9 @@ describe('Record.vue', () => {
|
||||
rows = wrapper.findAll('tbody tr')
|
||||
expect(rows[0].findAll('td')[0].text()).to.equals('2')
|
||||
expect(rows[1].findAll('td')[0].text()).to.equals('bar')
|
||||
selectedCell = wrapper
|
||||
.find('.sqliteviz-table tbody td[aria-selected="true"]')
|
||||
selectedCell = wrapper.find(
|
||||
'.sqliteviz-table tbody td[aria-selected="true"]'
|
||||
)
|
||||
expect(selectedCell.text()).to.equals('2')
|
||||
|
||||
await wrapper.find('.prev').trigger('click')
|
||||
@@ -67,8 +70,9 @@ describe('Record.vue', () => {
|
||||
rows = wrapper.findAll('tbody tr')
|
||||
expect(rows[0].findAll('td')[0].text()).to.equals('1')
|
||||
expect(rows[1].findAll('td')[0].text()).to.equals('foo')
|
||||
selectedCell = wrapper
|
||||
.find('.sqliteviz-table tbody td[aria-selected="true"]')
|
||||
selectedCell = wrapper.find(
|
||||
'.sqliteviz-table tbody td[aria-selected="true"]'
|
||||
)
|
||||
expect(selectedCell.text()).to.equals('1')
|
||||
|
||||
await wrapper.find('.last').trigger('click')
|
||||
@@ -76,8 +80,9 @@ describe('Record.vue', () => {
|
||||
rows = wrapper.findAll('tbody tr')
|
||||
expect(rows[0].findAll('td')[0].text()).to.equals('3')
|
||||
expect(rows[1].findAll('td')[0].text()).to.equals('baz')
|
||||
selectedCell = wrapper
|
||||
.find('.sqliteviz-table tbody td[aria-selected="true"]')
|
||||
selectedCell = wrapper.find(
|
||||
'.sqliteviz-table tbody td[aria-selected="true"]'
|
||||
)
|
||||
expect(selectedCell.text()).to.equals('3')
|
||||
|
||||
await wrapper.find('.first').trigger('click')
|
||||
@@ -85,8 +90,9 @@ describe('Record.vue', () => {
|
||||
rows = wrapper.findAll('tbody tr')
|
||||
expect(rows[0].findAll('td')[0].text()).to.equals('1')
|
||||
expect(rows[1].findAll('td')[0].text()).to.equals('foo')
|
||||
selectedCell = wrapper
|
||||
.find('.sqliteviz-table tbody td[aria-selected="true"]')
|
||||
selectedCell = wrapper.find(
|
||||
'.sqliteviz-table tbody td[aria-selected="true"]'
|
||||
)
|
||||
expect(selectedCell.text()).to.equals('1')
|
||||
})
|
||||
|
||||
@@ -105,12 +111,14 @@ describe('Record.vue', () => {
|
||||
}
|
||||
})
|
||||
|
||||
const selectedCell = wrapper
|
||||
.find('.sqliteviz-table tbody td[aria-selected="true"]')
|
||||
const selectedCell = wrapper.find(
|
||||
'.sqliteviz-table tbody td[aria-selected="true"]'
|
||||
)
|
||||
await selectedCell.trigger('click')
|
||||
|
||||
const selectedCellAfterClick = wrapper
|
||||
.find('.sqliteviz-table tbody td[aria-selected="true"]')
|
||||
const selectedCellAfterClick = wrapper.find(
|
||||
'.sqliteviz-table tbody td[aria-selected="true"]'
|
||||
)
|
||||
expect(selectedCellAfterClick.exists()).to.equals(false)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -39,8 +39,8 @@ describe('RunResult.vue', () => {
|
||||
expect(
|
||||
window.alert.calledOnceWith(
|
||||
"Your browser doesn't support copying into the clipboard. " +
|
||||
'If you use Firefox you can enable it ' +
|
||||
'by setting dom.events.asyncClipboard.clipboardItem to true.'
|
||||
'If you use Firefox you can enable it ' +
|
||||
'by setting dom.events.asyncClipboard.clipboardItem to true.'
|
||||
)
|
||||
).to.equal(true)
|
||||
|
||||
@@ -79,8 +79,9 @@ describe('RunResult.vue', () => {
|
||||
|
||||
// The dialog is shown...
|
||||
expect(wrapper.find('.dialog.vfm').exists()).to.equal(true)
|
||||
expect(wrapper.find('.dialog.vfm .dialog-header').text())
|
||||
.to.contain('Copy to clipboard')
|
||||
expect(wrapper.find('.dialog.vfm .dialog-header').text()).to.contain(
|
||||
'Copy to clipboard'
|
||||
)
|
||||
|
||||
// ... with Building message...
|
||||
expect(wrapper.find('.dialog-body').text()).to.equal('Building CSV...')
|
||||
@@ -96,7 +97,9 @@ describe('RunResult.vue', () => {
|
||||
expect(wrapper.find('.dialog-body').text()).to.equal('CSV is ready')
|
||||
|
||||
// Click copy
|
||||
await wrapper.find('.dialog-buttons-container button.primary').trigger('click')
|
||||
await wrapper
|
||||
.find('.dialog-buttons-container button.primary')
|
||||
.trigger('click')
|
||||
await window.navigator.clipboard.writeText.returnValues[0]
|
||||
|
||||
// The dialog is not shown...
|
||||
@@ -180,7 +183,9 @@ describe('RunResult.vue', () => {
|
||||
await nextTick()
|
||||
|
||||
// Click cancel
|
||||
await wrapper.find('.dialog-buttons-container button.secondary').trigger('click')
|
||||
await wrapper
|
||||
.find('.dialog-buttons-container button.secondary')
|
||||
.trigger('click')
|
||||
// The dialog is not shown...
|
||||
await clock.tick(100)
|
||||
expect(wrapper.find('.dialog.vfm').exists()).to.equal(false)
|
||||
@@ -246,8 +251,9 @@ describe('RunResult.vue', () => {
|
||||
|
||||
// Click on 'bar' cell again
|
||||
await rows[1].findAll('td')[1].trigger('click')
|
||||
expect(wrapper.find('.value-viewer-container .table-preview').text())
|
||||
.to.equals('No cell selected to view')
|
||||
expect(
|
||||
wrapper.find('.value-viewer-container .table-preview').text()
|
||||
).to.equals('No cell selected to view')
|
||||
wrapper.unmount()
|
||||
})
|
||||
|
||||
@@ -318,8 +324,9 @@ describe('RunResult.vue', () => {
|
||||
|
||||
// Click on 'foo' cell again
|
||||
await rows[1].find('td').trigger('click')
|
||||
expect(wrapper.find('.value-viewer-container .table-preview').text())
|
||||
.to.equals('No cell selected to view')
|
||||
expect(
|
||||
wrapper.find('.value-viewer-container .table-preview').text()
|
||||
).to.equals('No cell selected to view')
|
||||
wrapper.unmount()
|
||||
})
|
||||
|
||||
@@ -357,8 +364,9 @@ describe('RunResult.vue', () => {
|
||||
|
||||
// 'name-1' is selected
|
||||
expect(wrapper.find('.value-body').text()).to.equals('name-1')
|
||||
let selectedCell = wrapper
|
||||
.find('.sqliteviz-table tbody td[aria-selected="true"]')
|
||||
let selectedCell = wrapper.find(
|
||||
'.sqliteviz-table tbody td[aria-selected="true"]'
|
||||
)
|
||||
expect(selectedCell.text()).to.equals('name-1')
|
||||
|
||||
// Go to last record
|
||||
@@ -375,8 +383,9 @@ describe('RunResult.vue', () => {
|
||||
|
||||
// '29' is selected
|
||||
expect(wrapper.find('.value-body').text()).to.equals('29')
|
||||
selectedCell = wrapper
|
||||
.find('.sqliteviz-table tbody td[aria-selected="true"]')
|
||||
selectedCell = wrapper.find(
|
||||
'.sqliteviz-table tbody td[aria-selected="true"]'
|
||||
)
|
||||
expect(selectedCell.text()).to.equals('29')
|
||||
wrapper.unmount()
|
||||
})
|
||||
|
||||
@@ -25,7 +25,7 @@ describe('ValueViewer.vue', () => {
|
||||
}
|
||||
})
|
||||
await wrapper.find('button.json').trigger('click')
|
||||
expect(wrapper.find('.value-body').text()).to.equals('Can\'t parse JSON.')
|
||||
expect(wrapper.find('.value-body').text()).to.equals("Can't parse JSON.")
|
||||
})
|
||||
|
||||
it('copy to clipboard', async () => {
|
||||
@@ -38,7 +38,8 @@ describe('ValueViewer.vue', () => {
|
||||
|
||||
await wrapper.find('button.copy').trigger('click')
|
||||
|
||||
expect(window.navigator.clipboard.writeText.calledOnceWith('foo'))
|
||||
.to.equal(true)
|
||||
expect(window.navigator.clipboard.writeText.calledOnceWith('foo')).to.equal(
|
||||
true
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user