Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
spitfire305 committed Feb 16, 2024
1 parent 0b9e757 commit c2f0ea5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
1 change: 0 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@
<env name="DB_DATABASE" value=":memory:" />
<env name="TELESCOPE_ENABLED" value="false"/>
<env name="MAIL_MAILER" value="array"/>
<env name="APP_URL" value="http://localhost"/>
</php>
</phpunit>
23 changes: 8 additions & 15 deletions tests/Feature/Entities/EntityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,16 @@
->assertStatus(200)
;

it('POSTS a new character with a mention and checks that a new entity is created')
->asUser()
->withCampaign()
->postJson('/api/1.0/campaigns/1/characters', [
it('POSTS a new character with a mention and checks that a new entity is created', function () {
$this->asUser()
->withCampaign();

$response = $this->postJson('/api/1.0/campaigns/1/characters', [
'name' => fake()->name(),
'entry' => '[new:item|Mega sword]',
])
->assertStatus(201)
->assertJsonStructure([
'data' => [
'id',
'entity_id',
]
])
->assertJsonFragment(['entry_parsed' => '<a href="' . env('APP_URL') .
'/w/1/entities/1" class="entity-mention" data-entity-tags="" data-entity-type="item" data-toggle="tooltip-ajax" data-id="1" data-url="' .
env('APP_URL') . '/w/1/entities/1/tooltip">Mega sword</a>'])
]);
$this->assertStringStartsWith('<a href="', json_decode($response->content(), true)['data']['entry_parsed']);
})
;

it('Transfers entities')
Expand Down

0 comments on commit c2f0ea5

Please sign in to comment.