import 'package:flutter_test/flutter_test.dart';

import 'package:superport_v2/core/permissions/permission_manager.dart';
import 'package:superport_v2/core/permissions/permission_resources.dart';
import 'package:superport_v2/features/auth/domain/entities/auth_permission.dart';

void main() {
  group('AuthPermission', () {
    test('scope 리소스는 actions가 비어도 view 권한을 부여한다', () {
      const permission = AuthPermission(
        resource: 'scope:inventory.view',
        actions: [],
      );

      final map = permission.toPermissionMap();

      expect(map.length, 1);
      expect(
        map[PermissionResources.inventoryScope],
        contains(PermissionAction.view),
      );
    });
  });
}
