Merge branch 'master' into fb-pw-simple-project-config

This commit is contained in:
Philip Weiss
2018-03-09 14:06:14 -08:00
committed by GitHub
21 changed files with 383 additions and 112 deletions

View File

@@ -237,3 +237,30 @@ describe "PaneContainerElement", ->
atom.commands.dispatch(rightPane.getElement(), 'pane:decrease-size')
expect(leftPane.getFlexScale()).toBe 1/1.1
expect(rightPane.getFlexScale()).toBe 1/1.1
describe "when only a single pane is present", ->
[singlePane] = []
beforeEach ->
container = new PaneContainer(params)
singlePane = container.getActivePane()
describe "when pane:increase-size is triggered", ->
it "does not increases the size of the pane", ->
expect(singlePane.getFlexScale()).toBe 1
atom.commands.dispatch(singlePane.getElement(), 'pane:increase-size')
expect(singlePane.getFlexScale()).toBe 1
atom.commands.dispatch(singlePane.getElement(), 'pane:increase-size')
expect(singlePane.getFlexScale()).toBe 1
describe "when pane:decrease-size is triggered", ->
it "does not decreases the size of the pane", ->
expect(singlePane.getFlexScale()).toBe 1
atom.commands.dispatch(singlePane.getElement(), 'pane:decrease-size')
expect(singlePane.getFlexScale()).toBe 1
atom.commands.dispatch(singlePane.getElement(), 'pane:decrease-size')
expect(singlePane.getFlexScale()).toBe 1

View File

@@ -905,46 +905,6 @@ describe('TextEditorComponent', () => {
expect(component.getLineNumberGutterWidth()).toBe(originalLineNumberGutterWidth)
})
it('gracefully handles edits that change the maxScrollTop by causing the horizontal scrollbar to disappear', async () => {
const rowsPerTile = 1
const {component, element, editor} = buildComponent({rowsPerTile, autoHeight: false})
await setEditorHeightInLines(component, 1)
await setEditorWidthInCharacters(component, 7)
// Updating scrollbar styles.
const style = document.createElement('style')
style.textContent = '::-webkit-scrollbar { height: 17px; width: 10px; }'
jasmine.attachToDOM(style)
TextEditor.didUpdateScrollbarStyles()
await component.getNextUpdatePromise()
element.focus()
component.setScrollTop(component.measurements.lineHeight)
component.scheduleUpdate()
await component.getNextUpdatePromise()
editor.setSelectedBufferRange([[0, 1], [12, 2]])
editor.backspace()
// component.scheduleUpdate()
await component.getNextUpdatePromise()
expect(component.getScrollTop()).toBe(0)
const renderedLines = queryOnScreenLineElements(element).sort((a, b) => a.dataset.screenRow - b.dataset.screenRow)
const renderedLineNumbers = queryOnScreenLineNumberElements(element).sort((a, b) => a.dataset.screenRow - b.dataset.screenRow)
const renderedStartRow = component.getRenderedStartRow()
const expectedLines = editor.displayLayer.getScreenLines(renderedStartRow, component.getRenderedEndRow())
expect(renderedLines.length).toBe(expectedLines.length)
expect(renderedLineNumbers.length).toBe(expectedLines.length)
element.remove()
editor.destroy()
})
describe('randomized tests', () => {
let originalTimeout
@@ -961,7 +921,7 @@ describe('TextEditorComponent', () => {
const initialSeed = Date.now()
for (var i = 0; i < 20; i++) {
let seed = initialSeed + i
// seed = 1507231571985
// seed = 1520247533732
const failureMessage = 'Randomized test failed with seed: ' + seed
const random = Random(seed)
@@ -971,6 +931,11 @@ describe('TextEditorComponent', () => {
await setEditorWidthInCharacters(component, random(20))
await setEditorHeightInLines(component, random(10))
element.style.fontSize = random(20) + 'px'
element.style.lineHeight = random.floatBetween(0.1, 2.0)
TextEditor.didUpdateStyles()
await component.getNextUpdatePromise()
element.focus()
for (var j = 0; j < 5; j++) {