mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
chore: Select component refactoring - MetricControl - Iteration 5 (#16423)
* Refactor Select * Render saved metric option * Update tests * Fix Cypress and ariaLabels * Fix lint * Lint Cypress * Reconcile with latest Select changes
This commit is contained in:
@@ -73,7 +73,7 @@ describe('AdhocMetricEditPopover', () => {
|
||||
|
||||
it('overwrites the adhocMetric in state with onColumnChange', () => {
|
||||
const { wrapper } = setup();
|
||||
wrapper.instance().onColumnChange(columns[0].id);
|
||||
wrapper.instance().onColumnChange(columns[0].column_name);
|
||||
expect(wrapper.state('adhocMetric')).toEqual(
|
||||
sumValueAdhocMetric.duplicateWith({ column: columns[0] }),
|
||||
);
|
||||
@@ -100,7 +100,7 @@ describe('AdhocMetricEditPopover', () => {
|
||||
expect(wrapper.find(Button).find({ disabled: true })).not.toExist();
|
||||
wrapper.instance().onColumnChange(null);
|
||||
expect(wrapper.find(Button).find({ disabled: true })).toExist();
|
||||
wrapper.instance().onColumnChange(columns[0].id);
|
||||
wrapper.instance().onColumnChange(columns[0].column_name);
|
||||
expect(wrapper.find(Button).find({ disabled: true })).not.toExist();
|
||||
wrapper.instance().onAggregateChange(null);
|
||||
expect(wrapper.find(Button).find({ disabled: true })).toExist();
|
||||
@@ -109,7 +109,7 @@ describe('AdhocMetricEditPopover', () => {
|
||||
it('highlights save if changes are present', () => {
|
||||
const { wrapper } = setup();
|
||||
expect(wrapper.find(Button).find({ buttonStyle: 'primary' })).not.toExist();
|
||||
wrapper.instance().onColumnChange(columns[1].id);
|
||||
wrapper.instance().onColumnChange(columns[1].column_name);
|
||||
expect(wrapper.find(Button).find({ buttonStyle: 'primary' })).toExist();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user