0]); $this->team = Team::factory()->create(['show_boarding' => false]); $this->otherTeam = Team::factory()->create(['show_boarding' => false]); $this->project = Project::factory()->create(['team_id' => $this->team->id, 'name' => 'canvas-team-project']); $this->otherProject = Project::factory()->create(['team_id' => $this->otherTeam->id, 'name' => 'canvas-other-project']); $this->user = User::factory()->create(); }); function actingInCanvasTeam(object $test, Team $team): object { return $test->actingAs($test->user)->withSession(['currentTeam' => $team]) ->withHeader('X-Canvas-Team', (string) $team->id); } test('guests are sent to the login page', function () { $this->get('/canvas')->assertRedirect('/login'); }); test('team members can open the deploy canvas', function () { $this->team->members()->attach($this->user->id, ['role' => 'member']); actingInCanvasTeam($this, $this->team) ->withoutVite() ->get('/canvas') ->assertOk() ->assertSee('data-deploy-canvas', false); }); test('the deploy canvas page lists the service template logos for the service step', function () { $this->team->members()->attach($this->user->id, ['role' => 'member']); $template = get_service_templates()->first(fn ($template) => filled(data_get($template, 'logo')) && basename(data_get($template, 'logo')) !== 'default.webp'); $key = get_service_templates()->search($template); $html = actingInCanvasTeam($this, $this->team)->withoutVite()->get('/canvas')->assertOk()->getContent(); preg_match('/