Skip to content

A demo for how to use Livewire Dusk Testbench to test a Livewire component package

Notifications You must be signed in to change notification settings

joshhanley/livewire-package-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Livewire Package Demo

This is a demonstration of how you can create a package which contains Livewire components, and test them using Livewire Dusk Testbench.

The Components

This demo contains two different types of Livewire components:

  • Counter Component
  • Custom Input

The counter component, is a standard Livewire component which has both the component class and the required blade view. It's files can be found in src/CounterComponent.php and resources/views/livewire/counter-component.blade.php

The custom input, is a blade component which makes use of Livewire features (such as wire:model) which only has a blade view.

The Tests

There are a couple of different tests in the package which show how you could test your components to ensure they are working as expected.

The tests are in tests/Browser under three different folders:

  • Counter
  • ComponentWithCounter
  • ComponentWithCustomInput

The Counter test folder contains an example of how you could test your component in isolation, to test all it's functionality.

The ComponentWithCounter test folder contains an example of using the Counter Component inside another component and testing that works as expected.

The ComponentWithCustomInput test folder contains an example of using the Custom Input blade component inside a Livewire component to test it operates as expected.

Further Information

For any information on how to use Livewire Dusk Testbench or anything it uses, or creative packages, consult the relevant documentation.

About

A demo for how to use Livewire Dusk Testbench to test a Livewire component package

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published