mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
Fix of the spec *and rollback of a useless change*
This commit is contained in:
parent
05ec5a7c26
commit
68843f3c6d
@ -17,7 +17,7 @@ module.exports = class WrapGuideElement {
|
||||
this.setWhen(when);
|
||||
|
||||
this.element.updateGuide = (async () => await this.updateGuide()).bind(this);
|
||||
this.element.getDefaultColumn = (async () => await this.getDefaultColumn()).bind(this);
|
||||
this.element.getDefaultColumn = this.getDefaultColumn.bind(this);
|
||||
}
|
||||
|
||||
get shouldShow() { return this.#_shouldShow; }
|
||||
|
@ -58,13 +58,10 @@ describe("WrapGuideElement", function() {
|
||||
});
|
||||
|
||||
it("positions the guide at the configured column", function() {
|
||||
// const width = editor.getDefaultCharWidth() * wrapGuide.getDefaultColumn();
|
||||
waitsForPromise(() => wrapGuide.getDefaultColumn().then((column) => {
|
||||
const width = column * editor.getDefaultCharWidth();
|
||||
expect(width).toBeGreaterThan(0);
|
||||
expect(Math.abs(getLeftPosition(wrapGuide.firstChild) - width)).toBeLessThan(1);
|
||||
expect(wrapGuide).toBeVisible();
|
||||
}));
|
||||
const width = editor.getDefaultCharWidth() * wrapGuide.getDefaultColumn();
|
||||
expect(width).toBeGreaterThan(0);
|
||||
expect(Math.abs(getLeftPosition(wrapGuide.firstChild) - width)).toBeLessThan(1);
|
||||
expect(wrapGuide).toBeVisible();
|
||||
});
|
||||
|
||||
it("appends multiple wrap guides to all existing and new editors", function() {
|
||||
@ -311,7 +308,7 @@ describe("WrapGuideElement", function() {
|
||||
it('::getDefaultColumn returns the scope-specific column value', function() {
|
||||
atom.config.set('editor.preferredLineLength', 132, {scopeSelector: '.source.js'});
|
||||
|
||||
waitsForPromise(() => wrapGuide.getDefaultColumn().then((column) => expect(column).toBe(132)));
|
||||
expect(wrapGuide.getDefaultColumn()).toBe(132);
|
||||
});
|
||||
|
||||
it('updates the guide when the scope-specific column changes', function() {
|
||||
|
@ -7,6 +7,7 @@ describe('Wrap Guide', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await atom.packages.activatePackage('wrap-guide')
|
||||
atom.config.set('wrap-guide.showWrapGuide', 'always')
|
||||
|
||||
editor = await atom.workspace.open('sample.js')
|
||||
editorElement = editor.getElement()
|
||||
|
Loading…
Reference in New Issue
Block a user