Skip to content

Commit

Permalink
test: add e2e test for query builder grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
hoorayimhelping committed Feb 25, 2020
1 parent 52a0755 commit 215962a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
35 changes: 35 additions & 0 deletions ui/cypress/e2e/queryBuilder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,41 @@ describe('The Query Builder', () => {
})
})

describe('the group() function', () => {
it('creates a query that has a group() function in it', () => {
cy.get('@org').then((org: Organization) => {
cy.visit(`orgs/${org.id}/data-explorer`)
})

cy.contains('mem').click('left')
cy.getByTestID('builder-card')
.last()
.contains('Filter')
.click()
.get('.cf-dropdown--menu-container')
.contains('group')
.click()

const groupableColums = []

cy.getByTestID('builder-card')
.last()
.then($lastBuilderCard => {
$lastBuilderCard.find('.selector-list--item').each((index, $item) => {
groupableColums.push($item.innerHTML)
})

expect(groupableColums).to.eql([
'_start',
'_stop',
'_time',
'_measurement',
'_field',
])
})
})
})

// This is flaky in prod
// https://circleci.com/gh/influxdata/influxdb/74628#artifacts/containers/0
describe.skip('from the Dashboard view', () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/timeMachine/components/TagSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import {

const SEARCH_DEBOUNCE_MS = 500

// We don't show these columns in results but they're able to be grouped on
// We don't show these columns in results but they're able to be grouped on for most queries
const ADDITIONAL_GROUP_BY_COLUMNS = ['_start', '_stop', '_time']

interface StateProps {
Expand Down

0 comments on commit 215962a

Please sign in to comment.