@@ -61,7 +61,7 @@ describe("HCAGetDataDownloadsComponent", () => {
6161 /**
6262 * Confirm is matrix supported loading returns false when matrix is supported.
6363 */
64- it ( "should is matrix supported loading return false when matrix is supported" , ( ) => {
64+ it ( "detects matrix supported loading is false when matrix is supported" , ( ) => {
6565
6666 // Confirm is matrix supported loading returns false, when matrix is supported - first execute the
6767 // method and then confirm the returned value is false.
@@ -72,7 +72,7 @@ describe("HCAGetDataDownloadsComponent", () => {
7272 /**
7373 * Confirm is matrix supported loading returns false when matrix is not supported.
7474 */
75- it ( "should is matrix supported loading return false when matrix is not supported" , ( ) => {
75+ it ( "detects matrix supported loading is false when matrix is not supported" , ( ) => {
7676
7777 // Confirm is matrix supported loading returns false, when matrix is not supported - first execute the
7878 // method and then confirm the returned value is false.
@@ -83,7 +83,7 @@ describe("HCAGetDataDownloadsComponent", () => {
8383 /**
8484 * Confirm is matrix supported loading returns true when matrix is not yet determined.
8585 */
86- it ( "should is matrix supported loading return true when matrix is not yet determined" , ( ) => {
86+ it ( "detects matrix supported as loading when matrix is not yet determined" , ( ) => {
8787
8888 // Confirm is matrix supported loading returns true, when matrix is not yet determined - first execute the
8989 // method and then confirm the returned value is true.
@@ -94,7 +94,7 @@ describe("HCAGetDataDownloadsComponent", () => {
9494 /**
9595 * Confirm "Create Concatenated Expression Matrix" is displayed.
9696 */
97- it ( `should display "Create Concatenated Expression Matrix"` , ( ) => {
97+ it ( `displays "Create Concatenated Expression Matrix"` , ( ) => {
9898
9999 // Confirm "Create Concatenated Expression Matrix" is displayed
100100 expect ( isPanelHeaderDisplayed ( "Create Concatenated Expression Matrix" ) ) . toEqual ( true ) ;
@@ -103,7 +103,7 @@ describe("HCAGetDataDownloadsComponent", () => {
103103 /**
104104 * Confirm "Request an expression matrix for the selected data from the HCA Matrix service." is displayed when matrix enabled is true.
105105 */
106- it ( `should display "Request an expression matrix for the selected data from the HCA Matrix service." when matrix enabled is true` , ( ) => {
106+ it ( `displays "Request an expression matrix for the selected data from the HCA Matrix service." when matrix enabled is true` , ( ) => {
107107
108108 component . matrixEnabled = true ;
109109 fixture . detectChanges ( ) ;
@@ -115,7 +115,7 @@ describe("HCAGetDataDownloadsComponent", () => {
115115 /**
116116 * Confirm <warning> is not displayed when matrix enabled is true.
117117 */
118- it ( "should not display component warning when matrix enabled is true" , ( ) => {
118+ it ( "hides component warning when matrix enabled is true" , ( ) => {
119119
120120 component . matrixEnabled = true ;
121121 fixture . detectChanges ( ) ;
@@ -129,7 +129,7 @@ describe("HCAGetDataDownloadsComponent", () => {
129129 /**
130130 * Confirm matrix start button is not disabled when matrix enabled is true.
131131 */
132- it ( "should matrix start button is not disabled when matrix enabled is true" , ( ) => {
132+ it ( "enables matrix start button when matrix enabled is true" , ( ) => {
133133
134134 component . matrixEnabled = true ;
135135 fixture . detectChanges ( ) ;
@@ -144,7 +144,7 @@ describe("HCAGetDataDownloadsComponent", () => {
144144 /**
145145 * Confirm "Request an expression matrix for the selected data from the HCA Matrix service." is not displayed when matrix enabled is false.
146146 */
147- it ( `should not display "Request an expression matrix for the selected data from the HCA Matrix service." when matrix enabled is false` , ( ) => {
147+ it ( `hides "Request an expression matrix for the selected data from the HCA Matrix service." when matrix enabled is false` , ( ) => {
148148
149149 component . matrixEnabled = false ;
150150 fixture . detectChanges ( ) ;
@@ -156,7 +156,7 @@ describe("HCAGetDataDownloadsComponent", () => {
156156 /**
157157 * Confirm <warning> is displayed when matrix enabled is false.
158158 */
159- it ( "should display component warning when matrix enabled is false" , ( ) => {
159+ it ( "displays component warning when matrix enabled is false" , ( ) => {
160160
161161 component . matrixEnabled = false ;
162162 fixture . detectChanges ( ) ;
@@ -170,7 +170,7 @@ describe("HCAGetDataDownloadsComponent", () => {
170170 /**
171171 * Confirm matrix start button is disabled when matrix enabled is false.
172172 */
173- it ( "should matrix start button is not disabled when matrix enabled is false" , ( ) => {
173+ it ( "disables matrix start button when matrix enabled is false" , ( ) => {
174174
175175 component . matrixEnabled = false ;
176176 fixture . detectChanges ( ) ;
@@ -185,7 +185,7 @@ describe("HCAGetDataDownloadsComponent", () => {
185185 /**
186186 * Confirm "Request a File Manifest (for downloading files via the HCA CLI)" is displayed.
187187 */
188- it ( `should display "Request a File Manifest (for downloading files via the HCA CLI)"` , ( ) => {
188+ it ( `displays "Request a File Manifest (for downloading files via the HCA CLI)"` , ( ) => {
189189
190190 // Confirm "Request a File Manifest (for downloading files via the HCA CLI)" is displayed
191191 expect ( isPanelHeaderDisplayed ( "Request a File Manifest (for downloading files via the HCA CLI)" ) ) . toEqual ( true ) ;
@@ -194,7 +194,7 @@ describe("HCAGetDataDownloadsComponent", () => {
194194 /**
195195 * Confirm "Export to Terra" is displayed
196196 */
197- it ( `should display "Export to Terra"` , ( ) => {
197+ it ( `displays "Export to Terra"` , ( ) => {
198198
199199 fixture . detectChanges ( ) ;
200200
@@ -205,7 +205,7 @@ describe("HCAGetDataDownloadsComponent", () => {
205205 /**
206206 * Confirm emit "MATRIX" on click of matrix start button.
207207 */
208- it ( `should emit "MATRIX" on click of matrix start button` , ( ) => {
208+ it ( `emits "MATRIX" on click of matrix start button` , ( ) => {
209209
210210 component . matrixEnabled = true ;
211211 fixture . detectChanges ( ) ;
@@ -225,7 +225,7 @@ describe("HCAGetDataDownloadsComponent", () => {
225225 /**
226226 * Confirm emit "MANIFEST" on click of manifest start button.
227227 */
228- it ( `should emit "MANIFEST" on click of manifest start button` , ( ) => {
228+ it ( `emits "MANIFEST" on click of manifest start button` , ( ) => {
229229
230230 component . matrixEnabled = true ;
231231 fixture . detectChanges ( ) ;
@@ -245,7 +245,7 @@ describe("HCAGetDataDownloadsComponent", () => {
245245 /**
246246 * Confirm emit "TERRA" on click of terra start button.
247247 */
248- it ( `should emit "TERRA" on click of terra start button` , ( ) => {
248+ it ( `emits "TERRA" on click of terra start button` , ( ) => {
249249
250250 component . matrixEnabled = true ;
251251 fixture . detectChanges ( ) ;
@@ -262,6 +262,48 @@ describe("HCAGetDataDownloadsComponent", () => {
262262 expect ( selectedDownload ) . toBe ( DownloadViewState . TERRA ) ;
263263 } ) ;
264264
265+ /**
266+ * Confirm emit "MATRIX_SPECIES_SELECTION" if matrix species selection is required.
267+ */
268+ it ( `emits "MATRIX_SPECIES_SELECTION" on click of matrix start button when species selection is required` , ( ) => {
269+
270+ component . matrixEnabled = true ;
271+ component . matrixSpeciesSelectionRequired = true ;
272+ fixture . detectChanges ( ) ;
273+
274+ let selectedDownload : string ;
275+ component . downloadSelected . subscribe ( ( download : string ) => selectedDownload = download ) ;
276+
277+ const matrixStartButton = getButtonEl ( "MATRIX" ) ;
278+
279+ // Execute click on terra start button
280+ matrixStartButton . triggerEventHandler ( "click" , null ) ;
281+
282+ // Confirm emit "TERRA"
283+ expect ( selectedDownload ) . toBe ( DownloadViewState . MATRIX_SPECIES_SELECTION ) ;
284+ } ) ;
285+
286+ /**
287+ * Confirm emit "MATRIX" if matrix species selection is not required.
288+ */
289+ it ( `emits "MATRIX" on click of matrix start button when species selection is not required` , ( ) => {
290+
291+ component . matrixEnabled = true ;
292+ component . matrixSpeciesSelectionRequired = false ;
293+ fixture . detectChanges ( ) ;
294+
295+ let selectedDownload : string ;
296+ component . downloadSelected . subscribe ( ( download : string ) => selectedDownload = download ) ;
297+
298+ const matrixStartButton = getButtonEl ( "MATRIX" ) ;
299+
300+ // Execute click on terra start button
301+ matrixStartButton . triggerEventHandler ( "click" , null ) ;
302+
303+ // Confirm emit "TERRA"
304+ expect ( selectedDownload ) . toBe ( DownloadViewState . MATRIX ) ;
305+ } ) ;
306+
265307 /**
266308 * Returns button element for specified panel download type.
267309 *
0 commit comments