@@ -154,18 +154,18 @@ describe("Data Form Component", () => {
154154 } ) ;
155155
156156 it ( "should render toggle switch" , ( ) => {
157- UtilsTest . getByDataTest ( "test1-inputToggleSwitch" , "button " )
157+ UtilsTest . getByDataTest ( "test1-inputToggleSwitch" , "input " )
158158 . should ( "have.length" , 2 )
159159 } ) ;
160160
161161 it ( "should render toggle buttons" , ( ) => {
162- UtilsTest . getByDataTest ( "test1-inputToggleButtons" , "button " )
162+ UtilsTest . getByDataTest ( "test1-inputToggleButtons" , "input " )
163163 . should ( "have.length" , 3 )
164164 } ) ;
165165 } )
166166
167167
168- context ( "Complex Field" , ( ) => {
168+ context . only ( "Complex Field" , ( ) => {
169169 it ( "should render object list" , ( ) => {
170170 cy . log ( "Soon! render object list form" ) ;
171171 } ) ;
@@ -235,13 +235,8 @@ describe("Data Form Component", () => {
235235 } ) ;
236236
237237 it ( "should a table" , ( ) => {
238- cy . get ( "label" )
239- . contains ( "Table Example" )
240- . parents ( "div[class='row form-group ']" )
241- . within ( ( ) => {
242- cy . get ( "table" )
243- . should ( "be.visible" ) ;
244- } ) ;
238+ UtilsTest . getByDataTest ( "test1-inputTable" , "table" )
239+ . should ( "be.visible" ) ;
245240 } ) ;
246241
247242 it ( "should render 3 simple charts" , ( ) => {
@@ -267,41 +262,12 @@ describe("Data Form Component", () => {
267262 // Add element to the list
268263 // Remove element to the list
269264 // check require, validation, disable and others for inputc
270-
271265 // test: check if generate correctly url
272- // test: check if generate correctly url
273-
274-
275266 // it("when submit is pressed, input display error for empty field", () => {
276- // // how to identify btn data-form
277- // cy.get("button[class='btn btn-primary ']").contains("OK").click();
278-
279- // // TODO: search all input with require attr and verify is it visible
280- // cy.get(".has-error").should("be.visible");
281- // });
282-
267+ // how to identify btn data-form
268+ // search all input with require attr and verify is it visible
283269 // it("should type the first input field", () => {
284- // UtilsTest.getByDataTest("test1--id", "input").type("testing input fill");
285- // // cy.get("div[data-test-id='test1--status.description'] textarea").type("testing input fill");
286-
287- // UtilsTest.getByDataTest("test1--status.description", "textarea").type("testing input fill");
288- // // cy.get("button[class='btn btn-primary ']").contains("OK").click();
289- // });
290-
291- // // Approach #3 to access to type field (More specific field)
292- // it.skip("should type the first input field", () => {
293- // // cy.get("label").contains("Sample ID").parents("div[class='row form-group ']").within(()=> {
294- // // cy.get("input[type='text']").type("testing input fill");
295- // // });
296- // UtilsTest.enterField("Sample ID", "testing values");
297- // UtilsTest.submitForm();
298- // });
299-
300- // it("the second field should be disabled", () => {
301- // // cy.get("textarea").first().should("be.disabled");
302- // UtilsTest.getByDataTest("test1--description", "textarea")
303- // .should("be.disabled");
304- // });
270+ // Approach #3 to access to type field (More specific field)
305271
306272} ) ;
307273
0 commit comments