Skip to content

Commit a833a2c

Browse files
committed
test: encoded search keyword
1 parent 349746b commit a833a2c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/Integration/QueryDataTableTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,31 @@ public function it_can_perform_global_search()
8080
]);
8181
}
8282

83+
/** @test */
84+
public function it_can_perform_global_search_with_html_string()
85+
{
86+
User::create([
87+
'name' => e('Record & 21'),
88+
'email' => 'Email-21@example.com',
89+
]);
90+
91+
$this->assertEquals('Record & 21', User::find(21)->name);
92+
93+
$crawler = $this->call('GET', '/query/users', [
94+
'columns' => [
95+
['data' => 'name', 'name' => 'name', 'searchable' => 'true', 'orderable' => 'true'],
96+
['data' => 'email', 'name' => 'email', 'searchable' => 'true', 'orderable' => 'true'],
97+
],
98+
'search' => ['value' => 'Record & 21'],
99+
]);
100+
101+
$crawler->assertJson([
102+
'draw' => 0,
103+
'recordsTotal' => 21,
104+
'recordsFiltered' => 1,
105+
]);
106+
}
107+
83108
/** @test */
84109
public function it_can_skip_total_records_count_query()
85110
{

0 commit comments

Comments
 (0)