Skip to content

Commit

Permalink
fix global search query when old project exists
Browse files Browse the repository at this point in the history
  • Loading branch information
zajca committed Dec 16, 2024
1 parent 6f0edf1 commit a8a4b01
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/Backend/CommonPart2/SnapshottingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace Keboola\Test\Backend\CommonPart2;

use Keboola\StorageApi\Metadata;
use Keboola\StorageApi\Options\GlobalSearchOptions;
use Keboola\Test\Common\MetadataTest;
use Keboola\Test\StorageApiTestCase;
use Keboola\Csv\CsvFile;
Expand Down Expand Up @@ -75,7 +76,9 @@ public function testCreateTableFromSnapshotWithDifferentName(): void
$hashedUniqueTableName = sha1('new-table-' . $this->generateDescriptionForTestObject());
$newTableId = $this->_client->createTableFromSnapshot($this->getTestBucketId(), $snapshotId, $hashedUniqueTableName);

$apiCall = fn() => $this->_client->globalSearch($hashedUniqueTableName);
$apiCall = fn() => $this->_client->globalSearch($hashedUniqueTableName, new GlobalSearchOptions(
projectIds: [$this->_client->verifyToken()['owner']['id']],
));
$assertCallback = function ($searchResult) use ($hashedUniqueTableName) {
$this->assertSame(1, $searchResult['all'], 'GlobalSearch expected result count is not 1: ' . json_encode($searchResult));
$this->assertSame('table', $searchResult['items'][0]['type'], 'GlobalSearch');
Expand Down

0 comments on commit a8a4b01

Please sign in to comment.