From 127e4dbae404257f14e8a050c44c56964902c8ac Mon Sep 17 00:00:00 2001 From: simurai Date: Thu, 28 Jan 2016 23:46:38 +0900 Subject: [PATCH] Add specs for horizontal axis height --- spec/workspace-element-spec.coffee | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/spec/workspace-element-spec.coffee b/spec/workspace-element-spec.coffee index f05c77f9a..883bad2fc 100644 --- a/spec/workspace-element-spec.coffee +++ b/spec/workspace-element-spec.coffee @@ -93,6 +93,28 @@ describe "WorkspaceElement", -> atom.workspace.addFooterPanel({item: footerItem}) expect(footerItem.offsetWidth).toEqual(workspaceElement.offsetWidth) + it 'shrinks horizontal axis according to header/footer panels height', -> + workspaceElement = atom.views.getView(atom.workspace) + workspaceElement.style.height = '100px' + horizontalAxisElement = workspaceElement.querySelector('atom-workspace-axis.horizontal') + jasmine.attachToDOM(workspaceElement) + + originalHorizontalAxisHeight = horizontalAxisElement.offsetHeight + expect(workspaceElement.offsetHeight).toBeGreaterThan(0) + expect(originalHorizontalAxisHeight).toBeGreaterThan(0) + + headerItem = document.createElement('div') + headerItem.style.height = '10px' + atom.workspace.addHeaderPanel({item: headerItem}) + expect(headerItem.offsetHeight).toBeGreaterThan(0) + + footerItem = document.createElement('div') + footerItem.style.height = '15px' + atom.workspace.addFooterPanel({item: footerItem}) + expect(footerItem.offsetHeight).toBeGreaterThan(0) + + expect(horizontalAxisElement.offsetHeight).toEqual(originalHorizontalAxisHeight - headerItem.offsetHeight - footerItem.offsetHeight) + describe "the 'window:toggle-invisibles' command", -> it "shows/hides invisibles in all open and future editors", -> workspaceElement = atom.views.getView(atom.workspace)