Skip to content

Conversation

@thinkverse
Copy link
Contributor

@thinkverse thinkverse commented Jun 17, 2021

This PR adds tests for the blade directives. Tried testing @groupfeature directive but it keeps failing, stating "Exception: Property [features] does not exist on this collection instance", referring to the groupHasFeature method. Might be something to look into later.

public function groupHasFeature(string $featureName): bool
{
return $this->groups->features->contains('name', $featureName);
}

The added test will fail due to the die-dump in HasFeatures trait, but here's a screenshot of the test suite passing. 😀

Screen Shot 2021-06-17 at 12 31 18 PM

@thinkverse thinkverse changed the title Add tests for blade directives Add tests for blade directives And fix groupfeature directive Jun 17, 2021
@thinkverse
Copy link
Contributor Author

Played around with it a bit more and fixed the @groupfeature directive by deferring the feature check to hasFeatureThroughGroup instead of checking with contains, so now all blade directive works correctly and all tests pass. 👍

Screen Shot 2021-06-18 at 12 16 29 AM

@JustSteveKing JustSteveKing merged commit bb174d1 into JustSteveKing:main Jun 19, 2021
@JustSteveKing
Copy link
Owner

Merging, tests are failing - but I need to rework on this package either way!

@thinkverse
Copy link
Contributor Author

Due to the dd in HasFeatures trait yes, commented that out locally when running the test suite. 👍 Hopefully the tests I PR'ed will help during the refactoring. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants