Skip to content

Commit c5a955a

Browse files
Fix tests
1 parent f9703cb commit c5a955a

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

tests/Console/ConfigureCmsCommandTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,25 +131,25 @@ public static function configureOzuCollectionList(OzuCollectionListConfig $confi
131131
&& $request['list']['isPaginated'] == true
132132
&& $request['list']['defaultSort'] == ['column' => 'dummy-date', 'direction' => 'asc']
133133
&& $request['list']['columns'] == collect([
134-
[
134+
'dummy-text' => [
135135
'type' => 'text',
136136
'key' => 'dummy-text',
137137
'label' => 'Dummy text',
138138
'size' => 1,
139139
],
140-
[
140+
'dummy-check' => [
141141
'type' => 'check',
142142
'key' => 'dummy-check',
143143
'label' => 'Dummy check',
144144
'size' => 2,
145145
],
146-
[
146+
'dummy-image' => [
147147
'type' => 'image',
148148
'key' => 'dummy-image',
149149
'label' => 'Dummy image',
150150
'size' => 3,
151151
],
152-
[
152+
'dummy-date' => [
153153
'type' => 'date',
154154
'key' => 'dummy-date',
155155
'label' => 'Dummy date',
@@ -194,15 +194,15 @@ public static function configureOzuCollectionForm(OzuCollectionFormConfig $confi
194194

195195
Http::assertSentInOrder([
196196
fn (Request $request) => $request['form']['fields'] == collect([
197-
[
197+
'dummy-text' => [
198198
'type' => 'text',
199199
'key' => 'dummy-text',
200200
'label' => 'Dummy text',
201201
'validationRules' => ['required'],
202202
'helpMessage' => null,
203203
'isUpdatable' => true,
204204
],
205-
[
205+
'dummy-select' => [
206206
'type' => 'select',
207207
'key' => 'dummy-select',
208208
'label' => 'Dummy select',

tests/Unit/OzuEditorFieldTest.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,9 @@
3232
expect($field->toArray())
3333
->not->toHaveKey('allowedExtensions');
3434

35-
// Enable File button -> allowedExtensions present with defaults
36-
$field->setToolbar([
37-
OzuEditorToolbarButton::Bold,
38-
OzuEditorToolbarButton::File,
39-
]);
40-
41-
expect($field->toArray())
42-
->not->toHaveKey('allowedExtensions');
43-
44-
$field->setAllowedExtensions(['.jpg', '.pdf']);
35+
$field
36+
->setToolbar([OzuEditorToolbarButton::File])
37+
->setAllowedExtensions(['.jpg', '.pdf']);
4538

4639
expect($field->toArray())
4740
->toHaveKey('allowedExtensions')
@@ -60,7 +53,9 @@
6053

6154
// With File -> should work
6255
$fieldWithFile = OzuField::makeEditor('content')
63-
->setToolbar([OzuEditorToolbarButton::File]);
56+
->setToolbar([OzuEditorToolbarButton::File])
57+
->setAllowedExtensions(['.jpg', '.jpeg', '.png', '.pdf']);
58+
6459
$fieldWithFile->setMaxFileSize(12);
6560
expect($fieldWithFile->toArray()['maxFileSize'])->toBe(12);
6661

0 commit comments

Comments
 (0)