@@ -5,15 +5,15 @@ import { VariantAnalysisStatus } from '../../../remote-queries/shared/variant-an
55import { userEvent } from '@storybook/testing-library' ;
66
77describe ( VariantAnalysisHeader . name , ( ) => {
8- const onOpenQueryClick = jest . fn ( ) ;
9- const onViewQueryClick = jest . fn ( ) ;
8+ const onOpenQueryFileClick = jest . fn ( ) ;
9+ const onViewQueryTextClick = jest . fn ( ) ;
1010 const onStopQueryClick = jest . fn ( ) ;
1111 const onCopyRepositoryListClick = jest . fn ( ) ;
1212 const onExportResultsClick = jest . fn ( ) ;
1313
1414 afterEach ( ( ) => {
15- onOpenQueryClick . mockReset ( ) ;
16- onViewQueryClick . mockReset ( ) ;
15+ onOpenQueryFileClick . mockReset ( ) ;
16+ onViewQueryTextClick . mockReset ( ) ;
1717 onStopQueryClick . mockReset ( ) ;
1818 onCopyRepositoryListClick . mockReset ( ) ;
1919 onExportResultsClick . mockReset ( ) ;
@@ -24,9 +24,9 @@ describe(VariantAnalysisHeader.name, () => {
2424 < VariantAnalysisHeader
2525 queryName = "Query name"
2626 queryFileName = "example.ql"
27- status = { VariantAnalysisStatus . InProgress }
28- onOpenQueryClick = { onOpenQueryClick }
29- onViewQueryClick = { onViewQueryClick }
27+ variantAnalysisStatus = { VariantAnalysisStatus . InProgress }
28+ onOpenQueryFileClick = { onOpenQueryFileClick }
29+ onViewQueryTextClick = { onViewQueryTextClick }
3030 onStopQueryClick = { onStopQueryClick }
3131 onCopyRepositoryListClick = { onCopyRepositoryListClick }
3232 onExportResultsClick = { onExportResultsClick }
@@ -44,39 +44,39 @@ describe(VariantAnalysisHeader.name, () => {
4444 render ( ) ;
4545
4646 userEvent . click ( screen . getByText ( 'example.ql' ) ) ;
47- expect ( onOpenQueryClick ) . toHaveBeenCalledTimes ( 1 ) ;
47+ expect ( onOpenQueryFileClick ) . toHaveBeenCalledTimes ( 1 ) ;
4848 } ) ;
4949
5050 it ( 'renders a view query button' , ( ) => {
5151 render ( ) ;
5252
5353 userEvent . click ( screen . getByText ( 'View query' ) ) ;
54- expect ( onViewQueryClick ) . toHaveBeenCalledTimes ( 1 ) ;
54+ expect ( onViewQueryTextClick ) . toHaveBeenCalledTimes ( 1 ) ;
5555 } ) ;
5656
5757 it ( 'renders the stop query button when in progress' , ( ) => {
58- render ( { status : VariantAnalysisStatus . InProgress } ) ;
58+ render ( { variantAnalysisStatus : VariantAnalysisStatus . InProgress } ) ;
5959
6060 userEvent . click ( screen . getByText ( 'Stop query' ) ) ;
6161 expect ( onStopQueryClick ) . toHaveBeenCalledTimes ( 1 ) ;
6262 } ) ;
6363
6464 it ( 'renders the copy repository list button when succeeded' , ( ) => {
65- render ( { status : VariantAnalysisStatus . Succeeded } ) ;
65+ render ( { variantAnalysisStatus : VariantAnalysisStatus . Succeeded } ) ;
6666
6767 userEvent . click ( screen . getByText ( 'Copy repository list' ) ) ;
6868 expect ( onCopyRepositoryListClick ) . toHaveBeenCalledTimes ( 1 ) ;
6969 } ) ;
7070
7171 it ( 'renders the export results button when succeeded' , ( ) => {
72- render ( { status : VariantAnalysisStatus . Succeeded } ) ;
72+ render ( { variantAnalysisStatus : VariantAnalysisStatus . Succeeded } ) ;
7373
7474 userEvent . click ( screen . getByText ( 'Export results' ) ) ;
7575 expect ( onExportResultsClick ) . toHaveBeenCalledTimes ( 1 ) ;
7676 } ) ;
7777
7878 it ( 'does not render any buttons when failed' , ( ) => {
79- const { container } = render ( { status : VariantAnalysisStatus . Failed } ) ;
79+ const { container } = render ( { variantAnalysisStatus : VariantAnalysisStatus . Failed } ) ;
8080
8181 expect ( container . querySelectorAll ( 'vscode-button' ) . length ) . toEqual ( 0 ) ;
8282 } ) ;
0 commit comments