feat: Enable drilling in embedded (#34319)

This commit is contained in:
Vitor Avila
2025-08-05 02:23:00 -03:00
committed by GitHub
parent 791ea9860d
commit 49689eec6c
29 changed files with 1510 additions and 336 deletions

View File

@@ -310,7 +310,7 @@ test('Drill to detail modal is under featureflag', () => {
expect(screen.queryByText('Drill to detail')).not.toBeInTheDocument();
});
test('Should show "Drill to detail" with `can_explore` & `can_samples` perms', () => {
test('Should show "Drill to detail" with `can_explore`, `can_samples` & `can_get_drill_info` perms', () => {
(global as any).featureFlags = {
[FeatureFlag.DrillToDetail]: true,
};
@@ -320,13 +320,14 @@ test('Should show "Drill to detail" with `can_explore` & `can_samples` perms', (
Admin: [
['can_samples', 'Datasource'],
['can_explore', 'Superset'],
['can_get_drill_info', 'Dataset'],
],
});
openMenu();
expect(screen.getByText('Drill to detail')).toBeInTheDocument();
});
test('Should show "Drill to detail" with `can_drill` & `can_samples` perms', () => {
test('Should show "Drill to detail" with `can_drill` & `can_samples` & `can_get_drill_info` perms', () => {
(global as any).featureFlags = {
[FeatureFlag.DrillToDetail]: true,
};
@@ -339,13 +340,14 @@ test('Should show "Drill to detail" with `can_drill` & `can_samples` perms', ()
Admin: [
['can_samples', 'Datasource'],
['can_drill', 'Dashboard'],
['can_get_drill_info', 'Dataset'],
],
});
openMenu();
expect(screen.getByText('Drill to detail')).toBeInTheDocument();
});
test('Should show "Drill to detail" with both `canexplore` + `can_drill` & `can_samples` perms', () => {
test('Should show "Drill to detail" with both `canexplore` + `can_drill` & `can_samples` & `can_get_drill_info` perms', () => {
(global as any).featureFlags = {
[FeatureFlag.DrillToDetail]: true,
};
@@ -357,7 +359,9 @@ test('Should show "Drill to detail" with both `canexplore` + `can_drill` & `can_
renderWrapper(props, {
Admin: [
['can_samples', 'Datasource'],
['can_explore', 'Superset'],
['can_drill', 'Dashboard'],
['can_get_drill_info', 'Dataset'],
],
});
openMenu();
@@ -380,7 +384,7 @@ test('Should not show "Drill to detail" with neither of required perms', () => {
expect(screen.queryByText('Drill to detail')).not.toBeInTheDocument();
});
test('Should not show "Drill to detail" only `can_dril` perm', () => {
test('Should not show "Drill to detail" only `can_drill` perm', () => {
(global as any).featureFlags = {
[FeatureFlag.DrillToDetail]: true,
};
@@ -396,6 +400,64 @@ test('Should not show "Drill to detail" only `can_dril` perm', () => {
expect(screen.queryByText('Drill to detail')).not.toBeInTheDocument();
});
test('Should not show "Drill to detail" with only `can_drill` & `can_samples` perms', () => {
(global as any).featureFlags = {
[FeatureFlag.DrillToDetail]: true,
};
const props = {
...createProps(),
supersetCanExplore: false,
};
props.slice.slice_id = 18;
renderWrapper(props, {
Admin: [
['can_drill', 'Dashboard'],
['can_samples', 'Datasource'],
],
});
openMenu();
expect(screen.queryByText('Drill to detail')).not.toBeInTheDocument();
});
test('Should not show "Drill to detail" with only `can_explore` & `can_samples` perms', () => {
(global as any).featureFlags = {
[FeatureFlag.DrillToDetail]: true,
};
const props = {
...createProps(),
supersetCanExplore: false,
};
props.slice.slice_id = 18;
renderWrapper(props, {
Admin: [
['can_explore', 'Superset'],
['can_samples', 'Datasource'],
],
});
openMenu();
expect(screen.queryByText('Drill to detail')).not.toBeInTheDocument();
});
test('Should not show "Drill to detail" with only `can_explore`, `can_drill` & `can_samples` perms', () => {
(global as any).featureFlags = {
[FeatureFlag.DrillToDetail]: true,
};
const props = {
...createProps(),
supersetCanExplore: false,
};
props.slice.slice_id = 18;
renderWrapper(props, {
Admin: [
['can_explore', 'Superset'],
['can_samples', 'Datasource'],
['can_drill', 'Dashboard'],
],
});
openMenu();
expect(screen.queryByText('Drill to detail')).not.toBeInTheDocument();
});
test('Should show "View query"', () => {
const props = {
...createProps(),