feat(catalog): add show_in_selector attribute to item attributes and update related logic
This commit is contained in:
@@ -276,6 +276,26 @@ class CatalogItemDetailControllerTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function test_it_exposes_whether_an_item_attribute_should_be_shown_in_the_selector(): void
|
||||
{
|
||||
$tenant = $this->createTenant('detail-hidden-attribute');
|
||||
$item = $this->createItem($tenant, 'Hidden attribute');
|
||||
$attribute = Attribute::query()->create([
|
||||
'tenant_codigo' => $tenant->codigo,
|
||||
'codigo' => 'internal_type',
|
||||
'nombre' => 'Internal type',
|
||||
'type' => FieldType::String,
|
||||
]);
|
||||
$item->itemAttributes()->create([
|
||||
'attribute_id' => $attribute->id,
|
||||
'show_in_selector' => false,
|
||||
]);
|
||||
|
||||
$this->getJson("/api/tenants/{$tenant->codigo}/catalog-items/{$item->id}")
|
||||
->assertOk()
|
||||
->assertJsonPath('data.attributes.0.show_in_selector', false);
|
||||
}
|
||||
|
||||
private function createItem(
|
||||
Tenant $tenant,
|
||||
string $name,
|
||||
|
||||
Reference in New Issue
Block a user