Skip to content

Commit aace647

Browse files
committed
Test that rendering fields generates proper file inputs.
1 parent f5419d4 commit aace647

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

tests/Tags/Form/FormCreateTest.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,12 @@ public function it_renders_form_with_fields_array()
8787
$this->assertStringContainsString('<label>Full Name</label><input type="text" name="name" value="">', $output);
8888
$this->assertStringContainsString('<label>Email Address</label><input type="email" name="email" value="">', $output);
8989
$this->assertStringContainsString('<label>Message</label><textarea name="message" rows="5"></textarea>', $output);
90+
$this->assertStringContainsString('<input type="file" name="cat_selfie">', $output);
91+
$this->assertStringContainsString('<input type="file" name="armadillo_selfies[]" multiple>', $output);
9092

9193
preg_match_all('/<label>(.+)<\/label>/U', $output, $fieldOrder);
9294

93-
$this->assertEquals(['Full Name', 'Email Address', 'Message'], $fieldOrder[1]);
95+
$this->assertEquals(['Full Name', 'Email Address', 'Message', 'Cat Selfie', 'Armadillo Selfies'], $fieldOrder[1]);
9496
}
9597

9698
/** @test */
@@ -320,6 +322,21 @@ private function createContactForm()
320322
'validate' => 'required',
321323
],
322324
],
325+
[
326+
'handle' => 'cat_selfie',
327+
'field' => [
328+
'type' => 'assets',
329+
'display' => 'Cat Selfie',
330+
'max_files' => 1,
331+
],
332+
],
333+
[
334+
'handle' => 'armadillo_selfies',
335+
'field' => [
336+
'type' => 'assets',
337+
'display' => 'Armadillo Selfies',
338+
],
339+
],
323340
],
324341
]);
325342

0 commit comments

Comments
 (0)