Replies: 1 comment 1 reply
-
|
Have you tried giving the section a key? return $schema
->state($this->loadCurrentProviderState())
->components([
// ...some other Sections
Section::make('upload')
->key('upload_section') // !
->heading('Upload new Provider as JSON File')
->components([
// ... some other Components
Action::make('myAction')
->action(fn() => $this->myActionFunction()),
])
])->statePath(...);And then assert against it? ->assertActionExists(TestAction::make('myAction')->schemaComponent('upload_section));🤔 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Package
Actions
Package Version
v4.1.9/v4.6.0
How can we help you?
Entered two package versions, as i tested it in both.
I want to test a custom action i create and use within a schema on my Page(which implements HasSchemas and uses InteractsWithSchemas).
The Schema with the action looks like this:
And i am trying to test it my simply calling
Livewire:test(...)->assertActionExists('myAction');in in my PHPUnit tests, which doesnt work, giving me the error that an action named like thhis doesnt exist.->assertActionExists(TestAction::make('myAction'));and->assertActionExists(TestAction::make('myAction')->schemaComponent(...));also didnt work no matter what i entered as argument for schemaComponent.
I am at my wits end how i am supposed to test such an action existence much less how to call it in tests.
I could not find any further leads in the Docu or here on github, so i opened this discussion.
The schema/page works as expected in the browser.
Beta Was this translation helpful? Give feedback.
All reactions