Merge pull request #48 from pulsar-edit/fixing-failing-tests

Fixing failing tests
This commit is contained in:
confused_techie 2022-09-04 16:21:11 -07:00 committed by GitHub
commit fd9d8c3100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 6 deletions

View File

@ -589,7 +589,8 @@ describe('Config', () => {
atom.config.get('foo.bar.baz', { scope: ['.source.coffee'] })
).toBe(55);
advanceClock(150);
//advanceClock(150);
atom.config.save();
savedSettings.length = 0;
atom.config.unset('foo.bar.baz', { scopeSelector: '.source.coffee' });
@ -600,7 +601,8 @@ describe('Config', () => {
atom.config.get('foo.bar.ok', { scope: ['.source.coffee'] })
).toBe(20);
advanceClock(150);
//advanceClock(150);
atom.config.save();
expect(savedSettings[0]['.coffee.source']).toEqual({
foo: {
bar: {
@ -611,7 +613,8 @@ describe('Config', () => {
atom.config.unset('foo.bar.ok', { scopeSelector: '.source.coffee' });
advanceClock(150);
//advanceClock(150);
atom.config.save();
expect(savedSettings.length).toBe(2);
expect(savedSettings[1]['.coffee.source']).toBeUndefined();
});
@ -1265,7 +1268,8 @@ describe('Config', () => {
atom.config.set('foo.int', 50, { scopeSelector: '*' });
advanceClock(100);
//advanceClock(100);
atom.config.save();
expect(savedSettings[0]['*'].foo).toEqual({
bar: 'baz',

View File

@ -226,6 +226,7 @@ describe('PanelContainerElement', () => {
panel.show();
expect(document.activeElement).toBe(inputEl);
panel.destroy();
});
it('focuses the autoFocus element if available', () => {
@ -240,6 +241,7 @@ describe('PanelContainerElement', () => {
panel.show();
expect(document.activeElement).toBe(inputEl2);
panel.destroy();
});
it('focuses the entire panel item when no tabbable item is available and the panel is focusable', () => {
@ -249,6 +251,7 @@ describe('PanelContainerElement', () => {
spyOn(panelEl, 'focus');
panel.show();
expect(panelEl.focus).toHaveBeenCalled();
panel.destroy()
});
it('returns focus to the original activeElement', () => {

View File

@ -4059,7 +4059,7 @@ describe('TextEditorComponent', () => {
describe('on the lines', () => {
describe('when there is only one cursor', () => {
it('positions the cursor on single-click or when middle-clicking', async () => {
atom.config.set('editor.selectionClipboard', true);
atom.config.set('editor.selectionClipboard', false);
for (const button of [0, 1]) {
const { component, editor } = buildComponent();
const { lineHeight } = component.measurements;

View File

@ -1301,7 +1301,12 @@ module.exports = class Workspace extends Model {
// Open Atom's license in the active pane.
openLicense() {
return this.open(path.join(process.resourcesPath, 'LICENSE.md'));
const resPath = path.join(process.resourcesPath, 'LICENSE.md')
if(fs.existsSync(resPath)) {
return this.open(resPath);
} else {
return this.open(path.join(__dirname, '..', 'LICENSE.md'))
}
}
// Synchronously open the given URI in the active pane. **Only use this method