@@ -63,6 +63,9 @@ import { TYPE } from 'vue-toastification';
6363import { extractArgumentDocumentation , ParsedDocstring } from " @/utils/python-doc.utils" ;
6464import mixpanel from ' mixpanel-browser' ;
6565import { anonymize } from " @/utils" ;
66+ import { useRouter } from ' vue-router/composables' ;
67+
68+ const router = useRouter ();
6669
6770const { projectId, test, suiteId, testArguments } = defineProps <{
6871 projectId: number ,
@@ -77,8 +80,6 @@ const selectedSuite = ref<number | null>(null);
7780const testInputs = ref <{ [name : string ]: FunctionInputDTO }>({});
7881const doc = ref <ParsedDocstring | null >(null );
7982
80- onMounted (loadData );
81-
8283async 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