Skip to content

Commit

Permalink
fix(HistoryListItem, e2e tests): fix logic bug in HistoryListItem
Browse files Browse the repository at this point in the history
also adjusts e2e tests, removing the expectation that there will be 'greyed' out items in the history list on the network preview.
  • Loading branch information
ramfox committed Mar 2, 2020
1 parent 1a1981f commit 80a109f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion app/components/item/HistoryListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const HistoryListItem: React.FunctionComponent<HistoryListItemProps> = (props) =
})
}
data-tip={allowDisable && foreign ? 'This version is unavailable' : undefined}
onClick={() => { if (!allowDisable) props.onClick(path) }}
onClick={() => { if (!(foreign && allowDisable)) props.onClick(path) }}
>
<div className='icon-column'>
<div className='history-timeline-line history-timeline-line-top' />
Expand Down
9 changes: 0 additions & 9 deletions test/e2e/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,6 @@ describe('Qri End to End tests', function spec () {
atLocation,
click,
onStatusTab,
waitForExist,
doesNotExist,
waitForNotExist,
takeScreenshot
} = utils
Expand Down Expand Up @@ -592,8 +590,6 @@ describe('Qri End to End tests', function spec () {
// check we are at the right dataset
await waitForExist('#navbar-breadcrumb')
await expectTextToContain('#navbar-breadcrumb', registryDatasetName)
// history item has foreign class
await waitForExist('#HEAD-1.foreign')

if (takeScreenshots) {
await takeScreenshot(artifactPath('network-preview.png'))
Expand Down Expand Up @@ -653,11 +649,6 @@ describe('Qri End to End tests', function spec () {
// there should be two history items
const historyItems = await app.client.$$('.history-list-item')
expect(historyItems.length).toBe(2)

// first commit should have foreign class
await waitForExist('#HEAD-1.foreign')
// second commit should not
await waitForNotExist('#HEAD-2.foreign')
})

it('search: clicking a local dataset brings you to the workbench', async () => {
Expand Down

0 comments on commit 80a109f

Please sign in to comment.