mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-07 02:28:54 +08:00
add tests for isTabNeedName
This commit is contained in:
@@ -41,4 +41,27 @@ describe('storedQueries.js', () => {
|
||||
expect(copy).to.have.property('createdAt').which.within(now, nowPlusMinute)
|
||||
expect(copy).to.not.have.property('isPredefined')
|
||||
})
|
||||
|
||||
it('isTabNeedName returns false when the query has a name and is not predefined', () => {
|
||||
let tab = {
|
||||
initName: 'foo'
|
||||
}
|
||||
expect(storedQueries.isTabNeedName(tab)).to.be.false
|
||||
})
|
||||
|
||||
it('isTabNeedName returns true when the query has no name and is not predefined', () => {
|
||||
let tab = {
|
||||
initName: null,
|
||||
tempName: 'Untitled'
|
||||
}
|
||||
expect(storedQueries.isTabNeedName(tab)).to.be.true
|
||||
})
|
||||
|
||||
it('isTabNeedName returns true when the qiery is predefined', () => {
|
||||
let tab = {
|
||||
initName: 'foo',
|
||||
isPredefined: true
|
||||
}
|
||||
expect(storedQueries.isTabNeedName(tab)).to.be.true
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user