File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,25 @@ public function it_can_have_events()
5959 $ this ->assertEquals ($ event , $ editor ->events [0 ]);
6060 }
6161
62+ /** @test */
63+ public function it_can_show_hide_fields ()
64+ {
65+ $ editor = $ this ->getEditor ();
66+
67+ $ editor ->hiddenOnCreate (['name ' ]);
68+ $ editor ->hiddenOnEdit (['email ' ]);
69+
70+ $ this ->assertCount (2 , $ editor ->events );
71+
72+ $ this ->assertEquals ('preOpen ' , $ editor ->events [0 ]['event ' ]);
73+ $ this ->assertStringContainsString ("action === 'create' " , $ editor ->events [0 ]['script ' ]);
74+ $ this ->assertStringContainsString ("this.hide('name') " , $ editor ->events [0 ]['script ' ]);
75+
76+ $ this ->assertEquals ('preOpen ' , $ editor ->events [1 ]['event ' ]);
77+ $ this ->assertStringContainsString ("action === 'edit' " , $ editor ->events [1 ]['script ' ]);
78+ $ this ->assertStringContainsString ("this.hide('email') " , $ editor ->events [1 ]['script ' ]);
79+ }
80+
6281 /** @test */
6382 public function it_has_authorizations ()
6483 {
You can’t perform that action at this time.
0 commit comments