Giter Club home page Giter Club logo

Comments (8)

github-actions avatar github-actions commented on September 26, 2024

Hey @amirrezashahidi83! We're sorry to hear that you've hit this issue. 💛

However, it doesn't look like you've provided much information on how to replicate the issue. Please edit your original post with clear steps we need to take.

from filament.

github-actions avatar github-actions commented on September 26, 2024

Thank you for providing reproduction steps! Reopening the issue now.

from filament.

chengkangzai avatar chengkangzai commented on September 26, 2024

aren't this expected behaviour?
i think you should create a user and login with that user

it('creates admin',function () {

    $user = User::factory()->create();
    actingAs($user);

        livewire(\App\Filament\Resources\AdminResource\Pages\CreateAdmin::class)
        ->fillForm([

        ])
        ->call('create')
        ->assertHasNoFormErrors();
    }
);

from filament.

amirrezashahidi83 avatar amirrezashahidi83 commented on September 26, 2024

Thanks for your replay But it didn't worked.
I used dd(auth()->user()); to check my user data and it was ok,I can test target page successfuly
$response = $this->get('/admins/create'); $response->assertStatus(200);

from filament.

chengkangzai avatar chengkangzai commented on September 26, 2024

hmm does it mean that auth()->user() return an null?

from filament.

amirrezashahidi83 avatar amirrezashahidi83 commented on September 26, 2024

No I mean I can see user data without any problem. Here is output of dd():
App\Models\Admin {#3090 #connection: "mysql" #table: "admins" #primaryKey: "id" #keyType: "int" +incrementing: true #with: [] #withCount: [] +preventsLazyLoading: false #perPage: 15 +exists: true +wasRecentlyCreated: false #escapeWhenCastingToString: false #attributes: array:12 [ "id" => 1 "name" => "admin" "username" => "admin" "password" => "$2y$10$q1a0QkbWo0uCKxZKo6IFaODkx/KNO0ndJj8JiwzDlcrL4ZOufc9ma" "merchant_id" => "80b03beb-5c77-4b95-9c08-891a5fbeab30" "email" => "" "remember_token" => "DwQA11AyzRquqRzhTEGmNrjsSNyjS47fEjeZ6E8DMae2Of0XMxfMcXubMwsi" "created_at" => "2022-12-19 14:44:08" "updated_at" => "0000-00-00 00:00:00" "role" => "super" "school_id" => null "mobile_token" => "" ] #original: array:12 [ "id" => 1 "name" => "admin" "username" => "admin" "password" => "$2y$10$q1a0QkbWo0uCKxZKo6IFaODkx/KNO0ndJj8JiwzDlcrL4ZOufc9ma" "merchant_id" => "80b03beb-5c77-4b95-9c08-891a5fbeab30" "email" => "" "remember_token" => "DwQA11AyzRquqRzhTEGmNrjsSNyjS47fEjeZ6E8DMae2Of0XMxfMcXubMwsi" "created_at" => "2022-12-19 14:44:08" "updated_at" => "0000-00-00 00:00:00" "role" => "super" "school_id" => null "mobile_token" => "" ] #changes: [] #casts: [] #classCastCache: [] #attributeCastCache: [] #dateFormat: null #appends: [] #dispatchesEvents: [] #observables: [] #relations: [] #touches: [] +timestamps: true +usesUniqueIds: false #hidden: [] #visible: [] #guarded: [] #rememberTokenName: "remember_token" -roleClass: null -permissionClass: null -wildcardClass: null -wildcardPermissionsIndex: ? array } // tests\Feature\CreateResourcesTest.php:11

from filament.

chengkangzai avatar chengkangzai commented on September 26, 2024

I notice few problem after cloning your repo

  1. Your livewire keep giving 419 Problem, which solve by adding it to VerifyCSRFToken Middleware. Ref
  2. You did not install livewire pest plugin https://pestphp.com/docs/plugins#content-livewire
  3. Your Migration File is wrong, maybe you created your database schema manually without using laravel migration system ( there is no migration script for creating a admin table)
  4. You should use RefreshDatabase trait to get phpunit to automatically refresh your database while you test.

I suggest you to take a deeper dive on study in laravel <3

Cheers!

from filament.

amirrezashahidi83 avatar amirrezashahidi83 commented on September 26, 2024

It solved. I had to inject AdminPanelProvider in my tests

from filament.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.