@@ -297,7 +297,7 @@ module.exports = () => {
297297 it ( 'should successfully filter environments by their status history' , async ( ) => {
298298 /**
299299 * This is the sequence to test filtering the environments on their status history.
300- *
300+ *
301301 * @param {string } selector the filter input selector
302302 * @param {string } inputValue the value to type in the filter input
303303 * @param {string[] } expectedIds the list of expected environment IDs after filtering
@@ -308,7 +308,7 @@ module.exports = () => {
308308 await waitForTableLength ( page , expectedIds . length ) ;
309309 expect ( await page . $$eval ( 'tbody tr' , ( rows ) => rows . map ( ( row ) => row . id ) ) ) . to . eql ( expectedIds . map ( id => `row${ id } ` ) ) ;
310310 } ;
311-
311+
312312 await expectAttributeValue ( page , '.historyItems-filter input' , 'placeholder' , 'e.g. D-R-X' ) ;
313313
314314 await filterOnStatusHistory ( '.historyItems-filter input' , 'C-R-D-X' , [ 'TDI59So3d' ] ) ;
@@ -320,4 +320,31 @@ module.exports = () => {
320320 await filterOnStatusHistory ( '.historyItems-filter input' , 'D-E' , [ 'KGIS12DS' ] ) ;
321321 await resetFilters ( page ) ;
322322 } ) ;
323+
324+ it ( 'should successfully filter environments by their IDs' , async ( ) => {
325+ /**
326+ * This is the sequence to test filtering the environments on IDs.
327+ *
328+ * @param {string } selector the filter input selector
329+ * @param {string } inputValue the value to type in the filter input
330+ * @param {string[] } expectedIds the list of expected environment IDs after filtering
331+ * @return {void }
332+ */
333+ const filterOnID = async ( selector , inputValue , expectedIds ) => {
334+ await fillInput ( page , selector , inputValue , [ 'change' ] ) ;
335+ await waitForTableLength ( page , expectedIds . length ) ;
336+ expect ( await page . $$eval ( 'tbody tr' , ( rows ) => rows . map ( ( row ) => row . id ) ) ) . to . eql ( expectedIds . map ( id => `row${ id } ` ) ) ;
337+ } ;
338+
339+ await expectAttributeValue ( page , '.id-filter input' , 'placeholder' , 'e.g. CmCvjNbg, TDI59So3d...' ) ;
340+
341+ await filterOnID ( '.id-filter input' , 'CmCvjNbg' , [ 'CmCvjNbg' ] ) ;
342+ await resetFilters ( page ) ;
343+
344+ await filterOnID ( '.id-filter input' , 'CmCvjNbg, TDI59So3d' , [ 'CmCvjNbg' , 'TDI59So3d' ] ) ;
345+ await resetFilters ( page ) ;
346+
347+ await filterOnID ( '.id-filter input' , 'j' , [ 'CmCvjNbg' , 'GIDO1jdkD' , '8E4aZTjY' , 'Dxi029djX' ] ) ;
348+ await resetFilters ( page ) ;
349+ } ) ;
323350} ;
0 commit comments