Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Reliably update tab page test to mimic user interaction
Browse files Browse the repository at this point in the history
Test Plan:
npm run test -- --grep="shows the right number of tabs after closing with mouse"
  • Loading branch information
NejcZdovc authored and cezaraugusto committed Jul 17, 2017
1 parent ff263c0 commit 16ae489
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
12 changes: 11 additions & 1 deletion app/renderer/components/tabs/content/tabIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,22 @@ class TabIcon extends ImmutableComponent {
}
})

let altProps
if (!this.props.symbol) {
altProps = {
'data-test-id': this.props['data-test-id'],
'data-test2-id': this.props['data-test2-id']
}
}

return <div
className={this.props.className}
data-test-favicon={this.props['data-test-favicon']}
onDragStart={this.props.onDragStart}
draggable={this.props.draggable}
onClick={this.props.onClick}>
onClick={this.props.onClick}
{...altProps}
>
{
this.props.symbol
? <span
Expand Down
8 changes: 4 additions & 4 deletions test/tab-components/tabPagesTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const {
tabPage2,
activeWebview,
activeTab,
tabsTab
tabsTab,
closeTab
} = require('../lib/selectors')

describe('tab pages', function () {
Expand Down Expand Up @@ -59,11 +60,10 @@ describe('tab pages', function () {

it('shows the right number of tabs after closing with mouse', function * () {
const numTabsPerPage = appConfig.defaultSettings[settings.TABS_PER_PAGE]
const firstTabOfNewPageIndex = numTabsPerPage
yield this.app.client.click(newFrameButton)
.waitForElementCount(tabPage, 2)
.closeTabWithMouse()
.closeTabByIndex(firstTabOfNewPageIndex)
.moveToObject(activeTab)
.click(closeTab)
// No tab page indicator elements when 1 page
.waitForElementCount(tabPage, 0)
.waitForElementCount(tabsTabs, numTabsPerPage)
Expand Down

0 comments on commit 16ae489

Please sign in to comment.