Skip to content

Commit e9c3cfd

Browse files
Merge pull request #1184 from Giskard-AI/feature/gsk-1295-adding-test-to-a-test-suite-redirect-back-to-the-test-suite
[GSK-1295] Redirect to Testing after adding a test to current suite
2 parents 2f2440f + a730328 commit e9c3cfd

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

frontend/src/views/main/project/modals/AddTestToSuite.vue

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ import { TYPE } from 'vue-toastification';
6363
import { extractArgumentDocumentation, ParsedDocstring } from "@/utils/python-doc.utils";
6464
import mixpanel from 'mixpanel-browser';
6565
import { anonymize } from "@/utils";
66+
import { useRouter } from 'vue-router/composables';
67+
68+
const router = useRouter();
6669
6770
const { projectId, test, suiteId, testArguments } = defineProps<{
6871
projectId: number,
@@ -77,8 +80,6 @@ const selectedSuite = ref<number | null>(null);
7780
const testInputs = ref<{ [name: string]: FunctionInputDTO }>({});
7881
const doc = ref<ParsedDocstring | null>(null);
7982
80-
onMounted(loadData);
81-
8283
async function loadData() {
8384
doc.value = extractArgumentDocumentation(test)
8485
testSuites.value = await api.getTestSuites(projectId);
@@ -93,8 +94,6 @@ async function loadData() {
9394
}
9495
return result
9596
}, {} as { [name: string]: FunctionInputDTO })
96-
testInputs.value['model'].value = null;
97-
testInputs.value['dataset'].value = null;
9897
}
9998
10099
@@ -129,6 +128,17 @@ async function submit(close) {
129128
content: `'${test.displayName ?? test.name}' has been added to '${testSuites.value.find(({ id }) => id === selectedSuite.value)!.name}'`,
130129
color: TYPE.SUCCESS
131130
});
131+
132+
if (suiteId && suiteId === selectedSuite.value) {
133+
await router.push({
134+
name: 'test-suite-overview',
135+
params: {
136+
id: projectId.toString(),
137+
suiteId: selectedSuite.value!.toString()
138+
}
139+
});
140+
}
141+
132142
close();
133143
134144
mixpanel.track('Add test to test suite',
@@ -164,6 +174,9 @@ async function createTestSuite() {
164174
selectedSuite.value = suite;
165175
}
166176
177+
onMounted(async () => {
178+
await loadData();
179+
});
167180
</script>
168181

169182
<style scoped>

0 commit comments

Comments
 (0)