mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
Fix specs
This commit is contained in:
parent
e9e52f5052
commit
2cb9bc46ad
@ -8,6 +8,7 @@ describe('GrammarSelector', () => {
|
||||
beforeEach(async () => {
|
||||
jasmine.attachToDOM(atom.views.getView(atom.workspace))
|
||||
atom.config.set('grammar-selector.showOnRightSideOfStatusBar', false)
|
||||
atom.config.set('grammar-selector.hideDuplicateTextMateGrammars', false)
|
||||
|
||||
await atom.packages.activatePackage('status-bar')
|
||||
await atom.packages.activatePackage('grammar-selector')
|
||||
@ -30,13 +31,9 @@ describe('GrammarSelector', () => {
|
||||
await SelectListView.getScheduler().getNextUpdatePromise()
|
||||
|
||||
const grammarView = atom.workspace.getModalPanels()[0].getItem().element
|
||||
// TODO: Remove once Atom 1.23 reaches stable
|
||||
if (parseFloat(atom.getVersion()) >= 1.23) {
|
||||
// Do not take into account the two JS regex grammars or language-with-no-name
|
||||
expect(grammarView.querySelectorAll('li').length).toBe(atom.grammars.grammars.length - 3)
|
||||
} else {
|
||||
expect(grammarView.querySelectorAll('li').length).toBe(atom.grammars.grammars.length - 1)
|
||||
}
|
||||
|
||||
// -1 for removing nullGrammar, +1 for adding "Auto Detect"
|
||||
expect(grammarView.querySelectorAll('li').length).toBe(atom.grammars.grammars.filter(g => g.name).length)
|
||||
expect(grammarView.querySelectorAll('li')[0].textContent).toBe('Auto Detect')
|
||||
expect(grammarView.textContent.includes('source.a')).toBe(false)
|
||||
grammarView.querySelectorAll('li').forEach(li => expect(li.textContent).not.toBe(atom.grammars.nullGrammar.name))
|
||||
|
@ -458,7 +458,7 @@ class GrammarRegistry {
|
||||
}
|
||||
|
||||
get grammars () {
|
||||
return this.textmateRegistry.grammars
|
||||
return this.getGrammars({includeTreeSitter: true})
|
||||
}
|
||||
|
||||
decodeTokens () {
|
||||
|
Loading…
Reference in New Issue
Block a user