Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing #218

Merged
merged 7 commits into from
Apr 21, 2021
Merged

testing #218

merged 7 commits into from
Apr 21, 2021

Conversation

bdelamatre
Copy link
Contributor

After thinking through different ways to approach unit testing for the project, this is my attempt to add an initial testing suite. The test workflow is:

  • TestCase->setUp() boots up and creates a simple test database using sqlite
  • models and a datatable are created to match the test database
  • interactions are tested directly against the PetsTable component

The approach is simple in that it:

  • can be ran from within the project with no external dependencies
  • doesn't require bootstrapping an entire demo project

This approach is currently limited in that it:

  • can't execute Livewire / HTTP / Browser tests

An example test looks like this:

/** @test */
public function test_search_filter()
{
        $this->table->filters['search'] = 'Cartman';
        $this->assertEquals(1, $this->table->getRowsProperty()->total());
}

@rappasoft
Copy link
Owner

This is great thanks! I made some changes which you can see here: bff3714

I think it will be a good start, I appreciate all the effort you've been putting in to help with this package.

@rappasoft rappasoft added the Awaiting Next Release Currently merged into development awaiting a release to master label Apr 21, 2021
@rappasoft rappasoft merged commit d8d7919 into rappasoft:master Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Next Release Currently merged into development awaiting a release to master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants