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

The assertSessionHas() does not work with flash messages. #54

Closed
robsontenorio opened this issue Sep 23, 2023 · 3 comments
Closed

The assertSessionHas() does not work with flash messages. #54

robsontenorio opened this issue Sep 23, 2023 · 3 comments
Assignees

Comments

@robsontenorio
Copy link
Contributor

Volt Version

1.3.2

Laravel Version

10.23

PHP Version

8.2

Database Driver & Version

No response

Description

The assertSessionHas() does not work with flash messages.

Steps To Reproduce

Volt component

<?php

use Livewire\Volt\Component;

new class extends Component
{
    public function save()
    {
        session()->flash('message', 'ops!');
    }
}; ?>

<div>
    volt abc
</div>

Test

Volt::test('mycomponent')
            ->call('save')
            ->assertSessionHas('message', 'ops!');

Fail

image
@inmanturbo
Copy link

inmanturbo commented Sep 25, 2023

does this work for you with other session data? or is it only flash data?

@robsontenorio
Copy link
Contributor Author

robsontenorio commented Sep 25, 2023

@inmanturbo

flash() does not work.
session([x => y]) works.

But the issue here is about testing flash() messages.

@nunomaduro
Copy link
Collaborator

Can you double check if this issue also happens when using regular Livewire components? If not, please re-open this issue.

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

No branches or pull requests

4 participants