Skip to content

Commit

Permalink
Add delay option to WysiwygEditor (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasleitsch authored Nov 3, 2021
1 parent 6f674f9 commit 08d3fdd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/Fields/WysiwygEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,12 @@ public function toolbar(string $toolbar): self

return $this;
}

/** @return static */
public function delay(): self
{
$this->config->set('delay', true);

return $this;
}
}
8 changes: 7 additions & 1 deletion tests/Fields/WysiwygEditorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,18 @@ public function testTabs()
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid argument tabs [test].');

$field = WysiwygEditor::make('Wysiwyg Editor Inavlid Tabs')->tabs('test')->toArray();
$field = WysiwygEditor::make('Wysiwyg Editor Invalid Tabs')->tabs('test')->toArray();
}

public function testToolbar()
{
$field = WysiwygEditor::make('Wysiwyg Editor Toolbar')->toolbar('basic')->toArray();
$this->assertSame('basic', $field['toolbar']);
}

public function testDelay()
{
$field = WysiwygEditor::make('Wysiwyg Editor Delay')->delay()->toArray();
$this->assertSame(true, $field['delay']);
}
}

0 comments on commit 08d3fdd

Please sign in to comment.