Verified Commit f50c6a35 authored by Dave Long's avatar Dave Long
Browse files

Issue #3375406 by Akhil Babu, vaibhav_arora, shweta__sharma, Harish1688,...

Issue #3375406 by Akhil Babu, vaibhav_arora, shweta__sharma, Harish1688, Gauravvvv, Indrapatil, smustgrave: The 'Name' field in the Add form mode is required, even though it lacks any indication of being mandatory
parent ba4f2951
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ public function form(array $form, FormStateInterface $form_state) {
      '#title' => $this->t('Name'),
      '#maxlength' => 100,
      '#default_value' => $this->entity->label(),
      '#required' => TRUE,
    ];

    $form['description'] = [
+4 −0
Original line number Diff line number Diff line
@@ -64,6 +64,8 @@ public function testEntityViewModeUI() {

    // Test adding a view mode including dots in machine_name.
    $this->clickLink('Test entity');
    // Check if 'Name' field is required.
    $this->assertTrue($this->getSession()->getPage()->findField('label')->hasClass('required'));
    $edit = [
      'id' => $this->randomMachineName() . '.' . $this->randomMachineName(),
      'label' => $this->randomString(),
@@ -118,6 +120,8 @@ public function testEntityFormModeUI() {

    // Test adding a view mode including dots in machine_name.
    $this->clickLink('Test entity');
    // Check if 'Name' field is required.
    $this->assertTrue($this->getSession()->getPage()->findField('label')->hasClass('required'));
    $edit = [
      'id' => $this->randomMachineName() . '.' . $this->randomMachineName(),
      'label' => $this->randomString(),