mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-02 03:39:03 +00:00
Modify tests and remove action decorator
This commit is contained in:
parent
3b7f07b54e
commit
449da617d6
@ -3,7 +3,6 @@ import { get, computed, setProperties, getProperties } from '@ember/object';
|
||||
import { task, TaskInstance } from 'ember-concurrency';
|
||||
import ComputedProperty from '@ember/object/computed';
|
||||
import { IChartDatum } from 'wherehows-web/typings/app/visualization/charts';
|
||||
import { action } from '@ember-decorators/object';
|
||||
import healthCategories from 'wherehows-web/mirage/fixtures/health-categories';
|
||||
import healthSeverity from 'wherehows-web/mirage/fixtures/health-severity';
|
||||
|
||||
@ -122,7 +121,6 @@ export default class DatasetHealthContainer extends Component {
|
||||
});
|
||||
});
|
||||
|
||||
@action
|
||||
/**
|
||||
* Triggered when the user clicks on one of the bars in the summary charts child component, will trigger
|
||||
* a filter for whatever bar they select, unless it already is one in which case we will remove the filter
|
||||
|
||||
@ -2,5 +2,5 @@
|
||||
{{datasets/health/metrics-charts
|
||||
categoryData=renderedCategories
|
||||
severityData=renderedSeverity
|
||||
onCategorySelect=(action "onFilterSelect" "category")
|
||||
onSeveritySelect=(action "onFilterSelect" "severity")}}
|
||||
onCategorySelect=(action onFilterSelect "category")
|
||||
onSeveritySelect=(action onFilterSelect "severity")}}
|
||||
|
||||
@ -23,18 +23,15 @@ test('it provides the correct information', async function(assert) {
|
||||
{ name: 'Warning', value: 30, customColorClass: 'severity-chart__bar--warning' },
|
||||
{ name: 'Critical', value: 25, customColorClass: 'severity-chart__bar--critical' }
|
||||
];
|
||||
const testAction = datum => assert.equal(datum.name, 'Warnisng', 'Action successfully passes along info');
|
||||
|
||||
this.setProperties({
|
||||
categoryData,
|
||||
severityData,
|
||||
testAction
|
||||
severityData
|
||||
});
|
||||
|
||||
this.render(hbs`{{datasets/health/metrics-charts
|
||||
categoryData=categoryData
|
||||
severityData=severityData
|
||||
onBarSelect=testAction}}`);
|
||||
severityData=severityData}}`);
|
||||
|
||||
assert.ok(this.$(), 'Still renders without errors');
|
||||
assert.equal(this.$(chartClass).length, 2, 'Renders 2 charts');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user