Skip to content

Commit

Permalink
chore: drop unnecessary tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dtscalac committed Jan 16, 2025
1 parent dfa8011 commit 2feab11
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 230 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:convert';

import 'package:catalyst_voices_models/catalyst_voices_models.dart';
import 'package:catalyst_voices_repositories/src/dto/document/document_dto.dart';
import 'package:catalyst_voices_repositories/src/dto/document/schema/document_schema_dto.dart';
import 'package:test/test.dart';
Expand Down Expand Up @@ -59,58 +58,5 @@ void main() {
// verify they are the same
expect(deserializedDoc, equals(originalDoc));
});

test('Converts segments list into object for JSON', () {
// final schemaDto = DocumentSchemaDto.fromJson(schemaJson);
// final schema = schemaDto.toModel();

// final document = DocumentBuilder.fromSchema(
// schemaUrl: schemaPath,
// schema: schema,
// ).build();

// final documentDto = DocumentDto.fromModel(document);
// final documentJson = documentDto.toJson();

// for (final segment in documentDto.properties) {
// expect(documentJson[segment.schema.id], isA<Map<String, dynamic>>());
// }
});

test('Converts object from JSON into List of segments', () {
final schemaDto = DocumentSchemaDto.fromJson(schemaJson);
final schema = schemaDto.toModel();

final document = DocumentBuilder.fromSchema(
schemaUrl: schemaPath,
schema: schema,
).build();

final documentDto = DocumentDto.fromModel(document);

final documentJson = documentDto.toJson();
final documentDtoFromJson =
DocumentDto.fromJsonSchema(documentJson, schema);

expect(
documentDtoFromJson.properties.length,
documentDto.properties.length,
);
});

test('After serialization $DocumentPropertyValueDto has correct type', () {
// final schemaDto = DocumentSchemaDto.fromJson(schemaJson);
// final schema = schemaDto.toModel();

// final documentDto = DocumentDto.fromJsonSchema(documentJson, schema);

// final agreementSegment = documentDto.properties
// .indexWhere((e) => e.schema.nodeId.paths.last == 'agreements');
// expect(agreementSegment, isNot(equals(-1)));
// final agreementSections = documentDto.properties[agreementSegment].sections;
// final agreementProperty = agreementSections.first.properties.first
// as DocumentPropertyValueDto<Object>;
// expect(agreementProperty.value, true);
});
});
}

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 2feab11

Please sign in to comment.