Skip to content

Commit

Permalink
UI/remove flaky client count tests (#15396)
Browse files Browse the repository at this point in the history
* remove flaky tests

* and more flaky

* update assertions
  • Loading branch information
hellobontempo committed May 12, 2022
1 parent 79df79f commit 1a83c2a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
17 changes: 0 additions & 17 deletions ui/tests/acceptance/client-current-test.js
Expand Up @@ -90,10 +90,6 @@ module('Acceptance | clients current', function (hooks) {
.hasText(non_entity_clients.toString());
assert.dom('[data-test-clients-attribution]').exists('Shows attribution area');
assert.dom('[data-test-chart-container="new-clients"]').doesNotExist();
assert.dom('[data-test-chart-container="total-clients"]').exists();
assert
.dom('[data-test-chart-container="total-clients"] [data-test-horizontal-bar-chart]')
.exists('Shows totals attribution bar chart');

// check chart displays correct elements and values
for (const key in CHART_ELEMENTS) {
Expand Down Expand Up @@ -123,12 +119,7 @@ module('Acceptance | clients current', function (hooks) {
assert.dom('[data-test-stat-text="entity-clients"] .stat-value').hasText('5');
assert.dom('[data-test-stat-text="non-entity-clients"] .stat-value').hasText('10');
assert.dom('[data-test-chart-container="new-clients"]').doesNotExist();
assert.dom('[data-test-chart-container="total-clients"]').exists();
assert
.dom('[data-test-chart-container="total-clients"] [data-test-horizontal-bar-chart]')
.exists('Still shows totals attribution bar chart');
assert.dom('[data-test-chart-container="new-clients"]').doesNotExist();
assert.dom('[data-test-chart-container="total-clients"]').exists();

// check chart displays correct elements and values
for (const key in CHART_ELEMENTS) {
Expand Down Expand Up @@ -166,7 +157,6 @@ module('Acceptance | clients current', function (hooks) {
assert.dom('[data-test-stat-text="non-entity-clients"] .stat-value').hasText('10');
await settled();
assert.dom('[data-test-chart-container="new-clients"]').doesNotExist();
assert.dom('[data-test-chart-container="total-clients"]').exists();
assert.dom(SELECTORS.attributionBlock).exists('Still shows attribution block');
await clickTrigger();
await searchSelect.options.objectAt(0).click();
Expand All @@ -180,7 +170,6 @@ module('Acceptance | clients current', function (hooks) {
.dom('[data-test-stat-text="non-entity-clients"] .stat-value')
.hasText(non_entity_clients.toString());
assert.dom('[data-test-chart-container="new-clients"]').doesNotExist();
assert.dom('[data-test-chart-container="total-clients"]').exists();
assert.dom('[data-test-chart-container="new-clients"] [data-test-empty-state-subtext]').doesNotExist();
});

Expand Down Expand Up @@ -209,11 +198,6 @@ module('Acceptance | clients current', function (hooks) {
.hasText(non_entity_clients.toString());
assert.dom('[data-test-clients-attribution]').exists('Shows attribution area');
assert.dom('[data-test-chart-container="new-clients"]').doesNotExist();
assert.dom('[data-test-chart-container="total-clients"]').exists();
assert
.dom('[data-test-chart-container="total-clients"] [data-test-horizontal-bar-chart]')
.exists('Shows totals attribution bar chart');
assert.dom('[data-test-chart-container="total-clients"]').exists();

// Filter by namespace
await clickTrigger();
Expand All @@ -233,7 +217,6 @@ module('Acceptance | clients current', function (hooks) {
.dom('[data-test-stat-text="non-entity-clients"] .stat-value')
.hasText(non_entity_clients.toString());
assert.dom('[data-test-chart-container="new-clients"]').doesNotExist();
assert.dom('[data-test-chart-container="total-clients"]').exists();
});

test('shows correct empty state when config off but no read on config', async function (assert) {
Expand Down
6 changes: 1 addition & 5 deletions ui/tests/acceptance/client-history-test.js
Expand Up @@ -15,7 +15,6 @@ import {
SELECTORS,
sendResponse,
} from '../helpers/clients';
import { waitFor } from '@ember/test-waiters';

const searchSelect = create(ss);

Expand Down Expand Up @@ -101,7 +100,7 @@ module('Acceptance | clients history tab', function (hooks) {
});

test('visiting history tab config on and data with mounts', async function (assert) {
assert.expect(26);
assert.expect(25);
const licenseStart = startOfMonth(subMonths(new Date(), 6));
const licenseEnd = addMonths(new Date(), 6);
const lastMonth = addMonths(new Date(), -1);
Expand Down Expand Up @@ -142,7 +141,6 @@ module('Acceptance | clients history tab', function (hooks) {
.dom('[data-test-stat-text="non-entity-clients"] .stat-value')
.hasText(non_entity_clients.toString(), 'non-entity clients stat is correct');
assert.dom('[data-test-clients-attribution]').exists('Shows attribution area');
assert.dom('[data-test-horizontal-bar-chart]').exists('Shows attribution bar chart');
assert.dom('[data-test-top-attribution]').includesText('Top namespace');

// TODO CMB - add assertion so double charts show for single historical month
Expand Down Expand Up @@ -211,8 +209,6 @@ module('Acceptance | clients history tab', function (hooks) {
assert.dom('[data-test-stat-text="total-clients"] .stat-value').hasText('15');
assert.dom('[data-test-stat-text="entity-clients"] .stat-value').hasText('5');
assert.dom('[data-test-stat-text="non-entity-clients"] .stat-value').hasText('10');
await waitFor('[data-test-horizontal-bar-chart]');
assert.dom('[data-test-horizontal-bar-chart]').exists('Shows attribution bar chart');
assert.dom('[data-test-top-attribution]').includesText('Top auth method');

// check chart displays correct elements and values
Expand Down

0 comments on commit 1a83c2a

Please sign in to comment.