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()
59
59
$ this ->assertEquals ($ event , $ editor ->events [0 ]);
60
60
}
61
61
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
+
62
81
/** @test */
63
82
public function it_has_authorizations ()
64
83
{
You can’t perform that action at this time.
0 commit comments