Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
luanfreitasdev committed Dec 6, 2023
1 parent 1f71a8f commit a70b5a9
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/Feature/SetUpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
->ttl->toBe(300);

$tag = 'test-powergrid-dishes-default';
$cacheKey = '{"page":1}-{"perPage":15}-{"search":""}-{"sortDirection":"asc"}-{"sortField":"id"}-{"filters":[]}-{"sortArray":[]}';
$cacheKey = '{"page":1}-{"perPage":15}-{"search":""}-{"sortDirection":"asc"}-{"sortField":"id"}-{"filters":[]}';

$tags = \Illuminate\Support\Facades\Cache::tags($tag);

Expand All @@ -64,10 +64,10 @@
$storage = Livewire\invade($tags->getStore())->storage;

expect(json_encode($storage))
->toContain('{\"page\":1}-{\"perPage\":15}-{\"search\":\"\"}-{\"sortDirection\":\"asc\"}-{\"sortField\":\"id\"}-{\"filters\":[]}-{\"sortArray\":[]}');
->toContain('{\"page\":1}-{\"perPage\":15}-{\"search\":\"\"}-{\"sortDirection\":\"asc\"}-{\"sortField\":\"id\"}-{\"filters\":[]}');

$component->set('search', 'New search');
$cacheKeySearch = '{"page":1}-{"perPage":15}-{"search":"New search"}-{"sortDirection":"asc"}-{"sortField":"id"}-{"filters":[]}-{"sortArray":[]}';
$cacheKeySearch = '{"page":1}-{"perPage":15}-{"search":"New search"}-{"sortDirection":"asc"}-{"sortField":"id"}-{"filters":[]}';

/** @var LengthAwarePaginator $items */
$items = $tags->get($cacheKeySearch);
Expand Down Expand Up @@ -98,7 +98,7 @@
->ttl->toBe(360);

$tag = 'powergrid-dishes-default';
$cacheKey = '{"page":1}-{"perPage":15}-{"search":""}-{"sortDirection":"asc"}-{"sortField":"id"}-{"filters":[]}-{"sortArray":[]}';
$cacheKey = '{"page":1}-{"perPage":15}-{"search":""}-{"sortDirection":"asc"}-{"sortField":"id"}-{"filters":[]}';

$tags = \Illuminate\Support\Facades\Cache::tags($tag);

Expand All @@ -112,10 +112,10 @@
$storage = Livewire\invade($tags->getStore())->storage;

expect(json_encode($storage))
->toContain('{\"page\":1}-{\"perPage\":15}-{\"search\":\"\"}-{\"sortDirection\":\"asc\"}-{\"sortField\":\"id\"}-{\"filters\":[]}-{\"sortArray\":[]}');
->toContain('{\"page\":1}-{\"perPage\":15}-{\"search\":\"\"}-{\"sortDirection\":\"asc\"}-{\"sortField\":\"id\"}-{\"filters\":[]}');

$component->set('search', 'New search');
$cacheKeySearch = '{"page":1}-{"perPage":15}-{"search":"New search"}-{"sortDirection":"asc"}-{"sortField":"id"}-{"filters":[]}-{"sortArray":[]}';
$cacheKeySearch = '{"page":1}-{"perPage":15}-{"search":"New search"}-{"sortDirection":"asc"}-{"sortField":"id"}-{"filters":[]}';

/** @var LengthAwarePaginator $items */
$items = $tags->get($cacheKeySearch);
Expand Down Expand Up @@ -147,7 +147,7 @@
->ttl->toBe(360);

$tag = 'my-custom-tag';
$cacheKey = '{"page":1}-{"perPage":15}-{"search":""}-{"sortDirection":"asc"}-{"sortField":"id"}-{"filters":[]}-{"sortArray":[]}';
$cacheKey = '{"page":1}-{"perPage":15}-{"search":""}-{"sortDirection":"asc"}-{"sortField":"id"}-{"filters":[]}';

$tags = \Illuminate\Support\Facades\Cache::tags($tag);

Expand All @@ -161,10 +161,10 @@
$storage = Livewire\invade($tags->getStore())->storage;

expect(json_encode($storage))
->toContain('{\"page\":1}-{\"perPage\":15}-{\"search\":\"\"}-{\"sortDirection\":\"asc\"}-{\"sortField\":\"id\"}-{\"filters\":[]}-{\"sortArray\":[]}');
->toContain('{\"page\":1}-{\"perPage\":15}-{\"search\":\"\"}-{\"sortDirection\":\"asc\"}-{\"sortField\":\"id\"}-{\"filters\":[]}');

$component->set('search', 'New search');
$cacheKeySearch = '{"page":1}-{"perPage":15}-{"search":"New search"}-{"sortDirection":"asc"}-{"sortField":"id"}-{"filters":[]}-{"sortArray":[]}';
$cacheKeySearch = '{"page":1}-{"perPage":15}-{"search":"New search"}-{"sortDirection":"asc"}-{"sortField":"id"}-{"filters":[]}';

/** @var LengthAwarePaginator $items */
$items = $tags->get($cacheKeySearch);
Expand Down

0 comments on commit a70b5a9

Please sign in to comment.