@@ -824,15 +824,6 @@ describe("pat-validation", function () {
824
824
inp_end . value = "2020-10-05" ;
825
825
inp_end . dispatchEvent ( events . change_event ( ) ) ;
826
826
await utils . timeout ( 1 ) ; // wait a tick for async to settle.
827
- expect ( el . querySelectorAll ( "em.warning" ) . length ) . toBe ( 1 ) ;
828
- expect ( el . querySelectorAll ( "em.warning" ) [ 0 ] . textContent ) . toBe (
829
- "The end date must on or before the start date."
830
- ) ;
831
-
832
- // Violate the before/after constraint
833
- inp_start . value = "2020-10-06" ;
834
- inp_start . dispatchEvent ( events . change_event ( ) ) ;
835
- await utils . timeout ( 1 ) ; // wait a tick for async to settle.
836
827
expect ( el . querySelectorAll ( "em.warning" ) . length ) . toBe ( 2 ) ;
837
828
expect ( el . querySelectorAll ( "em.warning" ) [ 0 ] . textContent ) . toBe (
838
829
"The start date must on or before the end date."
@@ -849,6 +840,18 @@ describe("pat-validation", function () {
849
840
await utils . timeout ( 1 ) ; // wait a tick for async to settle.
850
841
expect ( el . querySelectorAll ( "em.warning" ) . length ) . toBe ( 0 ) ;
851
842
843
+ // Violate the before/after constraint
844
+ inp_start . value = "2020-10-11" ;
845
+ inp_start . dispatchEvent ( events . change_event ( ) ) ;
846
+ await utils . timeout ( 1 ) ; // wait a tick for async to settle.
847
+ expect ( el . querySelectorAll ( "em.warning" ) . length ) . toBe ( 2 ) ;
848
+ expect ( el . querySelectorAll ( "em.warning" ) [ 0 ] . textContent ) . toBe (
849
+ "The start date must on or before the end date."
850
+ ) ;
851
+ expect ( el . querySelectorAll ( "em.warning" ) [ 1 ] . textContent ) . toBe (
852
+ "The end date must on or before the start date."
853
+ ) ;
854
+
852
855
// Fulfill the before/after constraint - start before end
853
856
inp_start . value = "2020-10-01" ;
854
857
inp_start . dispatchEvent ( events . change_event ( ) ) ;
@@ -947,15 +950,6 @@ describe("pat-validation", function () {
947
950
inp_end . value = "2022-01-05T09:00" ;
948
951
inp_end . dispatchEvent ( events . change_event ( ) ) ;
949
952
await utils . timeout ( 1 ) ; // wait a tick for async to settle.
950
- expect ( el . querySelectorAll ( "em.warning" ) . length ) . toBe ( 1 ) ;
951
- expect ( el . querySelectorAll ( "em.warning" ) [ 0 ] . textContent ) . toBe (
952
- "The end date/time must on or before the start date/time."
953
- ) ;
954
-
955
- // Violate the before/after constraint
956
- inp_start . value = "2022-01-05T11:00" ;
957
- inp_start . dispatchEvent ( events . change_event ( ) ) ;
958
- await utils . timeout ( 1 ) ; // wait a tick for async to settle.
959
953
expect ( el . querySelectorAll ( "em.warning" ) . length ) . toBe ( 2 ) ;
960
954
expect ( el . querySelectorAll ( "em.warning" ) [ 0 ] . textContent ) . toBe (
961
955
"The start date/time must on or before the end date/time."
@@ -972,6 +966,18 @@ describe("pat-validation", function () {
972
966
await utils . timeout ( 1 ) ; // wait a tick for async to settle.
973
967
expect ( el . querySelectorAll ( "em.warning" ) . length ) . toBe ( 0 ) ;
974
968
969
+ // Violate the before/after constraint
970
+ inp_start . value = "2022-01-05T11:00" ;
971
+ inp_start . dispatchEvent ( events . change_event ( ) ) ;
972
+ await utils . timeout ( 1 ) ; // wait a tick for async to settle.
973
+ expect ( el . querySelectorAll ( "em.warning" ) . length ) . toBe ( 2 ) ;
974
+ expect ( el . querySelectorAll ( "em.warning" ) [ 0 ] . textContent ) . toBe (
975
+ "The start date/time must on or before the end date/time."
976
+ ) ;
977
+ expect ( el . querySelectorAll ( "em.warning" ) [ 1 ] . textContent ) . toBe (
978
+ "The end date/time must on or before the start date/time."
979
+ ) ;
980
+
975
981
// Fulfill the before/after constraint - start before end
976
982
inp_start . value = "2022-01-04T10:00" ;
977
983
inp_start . dispatchEvent ( events . change_event ( ) ) ;
0 commit comments