chore: remove git tracked auto-gen *_test.dart in `test/features`

This commit is contained in:
insleker 2025-08-29 19:24:16 +08:00
parent b2ac63d22b
commit 52a278e969
9 changed files with 1 additions and 339 deletions

View File

@ -48,6 +48,7 @@ dependencies:
go_router: ^16.2.0
flutter_localizations:
sdk: flutter
intl: any
dev_dependencies:
flutter_test:

View File

@ -1,38 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import './step/an_empty_signature_canvas.dart';
import './step/the_user_draws_strokes_and_confirms.dart';
import './step/a_signature_image_is_created.dart';
import './step/it_is_placed_on_the_selected_page.dart';
import './step/a_drawn_signature_exists_in_the_canvas.dart';
import './step/the_user_clears_the_canvas.dart';
import './step/the_canvas_becomes_blank.dart';
import './step/multiple_strokes_were_drawn.dart';
import './step/the_user_chooses_undo.dart';
import './step/the_last_stroke_is_removed.dart';
void main() {
group('''draw signature''', () {
testWidgets('''Draw with mouse or touch and place on page''',
(tester) async {
await anEmptySignatureCanvas(tester);
await theUserDrawsStrokesAndConfirms(tester);
await aSignatureImageIsCreated(tester);
await itIsPlacedOnTheSelectedPage(tester);
});
testWidgets('''Clear and redraw''', (tester) async {
await aDrawnSignatureExistsInTheCanvas(tester);
await theUserClearsTheCanvas(tester);
await theCanvasBecomesBlank(tester);
});
testWidgets('''Undo the last stroke''', (tester) async {
await multipleStrokesWereDrawn(tester);
await theUserChoosesUndo(tester);
await theLastStrokeIsRemoved(tester);
});
});
}

View File

@ -1,30 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import './step/a_signature_image_is_placed_on_the_page.dart';
import './step/the_user_drags_handles_to_resize_and_drags_to_reposition.dart';
import './step/the_size_and_position_update_in_real_time.dart';
import './step/the_signature_remains_within_the_page_area.dart';
import './step/a_signature_image_is_selected.dart';
import './step/the_user_enables_aspect_ratio_lock_and_resizes.dart';
import './step/the_image_scales_proportionally.dart';
void main() {
group('''geometrically adjust signature picture''', () {
testWidgets('''Resize and move the signature within page bounds''',
(tester) async {
await aSignatureImageIsPlacedOnThePage(tester);
await theUserDragsHandlesToResizeAndDragsToReposition(tester);
await theSizeAndPositionUpdateInRealTime(tester);
await theSignatureRemainsWithinThePageArea(tester);
});
testWidgets('''Lock aspect ratio while resizing''', (tester) async {
await aSignatureImageIsSelected(tester);
await theUserEnablesAspectRatioLockAndResizes(tester);
await theImageScalesProportionally(tester);
});
});
}

View File

@ -1,30 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import './step/a_signature_image_is_selected.dart';
import './step/the_user_enables_background_removal.dart';
import './step/nearwhite_background_becomes_transparent_in_the_preview.dart';
import './step/the_user_can_apply_the_change.dart';
import './step/the_user_changes_contrast_and_brightness_controls.dart';
import './step/the_preview_updates_immediately.dart';
import './step/the_user_can_apply_or_reset_adjustments.dart';
void main() {
group('''graphically adjust signature picture''', () {
testWidgets('''Remove background''', (tester) async {
await aSignatureImageIsSelected(tester);
await theUserEnablesBackgroundRemoval(tester);
await nearwhiteBackgroundBecomesTransparentInThePreview(tester);
await theUserCanApplyTheChange(tester);
});
testWidgets('''Adjust contrast and brightness''', (tester) async {
await aSignatureImageIsSelected(tester);
await theUserChangesContrastAndBrightnessControls(tester);
await thePreviewUpdatesImmediately(tester);
await theUserCanApplyOrResetAdjustments(tester);
});
});
}

View File

@ -1,47 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import './step/a_pdf_page_is_selected_for_signing.dart';
import './step/the_user_chooses_a_signature_image_file.dart';
import './step/the_image_is_loaded_and_shown_as_a_signature_asset.dart';
import './step/the_user_selects.dart';
import './step/the_app_attempts_to_load_the_image.dart';
import './step/the_user_is_notified_of_the_issue.dart';
import './step/the_image_is_not_added_to_the_document.dart';
void main() {
group('''load signature picture''', () {
testWidgets('''Import a signature image''', (tester) async {
await aPdfPageIsSelectedForSigning(tester);
await theUserChoosesASignatureImageFile(tester);
await theImageIsLoadedAndShownAsASignatureAsset(tester);
});
testWidgets(
'''Outline: Handle invalid or unsupported files ('corrupted.png')''',
(tester) async {
await theUserSelects(tester, 'corrupted.png');
await theAppAttemptsToLoadTheImage(tester);
await theUserIsNotifiedOfTheIssue(tester);
await theImageIsNotAddedToTheDocument(tester);
});
testWidgets(
'''Outline: Handle invalid or unsupported files ('signature.bmp')''',
(tester) async {
await theUserSelects(tester, 'signature.bmp');
await theAppAttemptsToLoadTheImage(tester);
await theUserIsNotifiedOfTheIssue(tester);
await theImageIsNotAddedToTheDocument(tester);
});
testWidgets(
'''Outline: Handle invalid or unsupported files ('empty.jpg')''',
(tester) async {
await theUserSelects(tester, 'empty.jpg');
await theAppAttemptsToLoadTheImage(tester);
await theUserIsNotifiedOfTheIssue(tester);
await theImageIsNotAddedToTheDocument(tester);
});
});
}

View File

@ -1,29 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import './step/a_pdf_document_is_available.dart';
import './step/the_user_opens_the_document.dart';
import './step/the_first_page_is_displayed.dart';
import './step/the_user_can_move_to_the_next_or_previous_page.dart';
import './step/a_multipage_pdf_is_open.dart';
import './step/the_user_selects_a_specific_page_number.dart';
import './step/that_page_is_displayed.dart';
void main() {
group('''PDF browser''', () {
testWidgets('''Open a PDF and navigate pages''', (tester) async {
await aPdfDocumentIsAvailable(tester);
await theUserOpensTheDocument(tester);
await theFirstPageIsDisplayed(tester);
await theUserCanMoveToTheNextOrPreviousPage(tester);
});
testWidgets('''Jump to a specific page''', (tester) async {
await aMultipagePdfIsOpen(tester);
await theUserSelectsASpecificPageNumber(tester);
await thatPageIsDisplayed(tester);
});
});
}

View File

@ -1,52 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import './step/a_new_provider_container.dart';
import './step/i_openpicked_with_path_and_pagecount.dart';
import './step/pdf_state_is_loaded.dart';
import './step/pdf_picked_path_is.dart';
import './step/pdf_page_count_is.dart';
import './step/pdf_current_page_is.dart';
import './step/pdf_marked_for_signing_is.dart';
import './step/a_pdf_is_open_with_path_and_pagecount.dart';
import './step/i_jumpto.dart';
import './step/i_toggle_mark.dart';
import './step/i_set_page_count.dart';
void main() {
group('''PDF state logic''', () {
testWidgets('''openPicked loads document and initializes state''',
(tester) async {
await aNewProviderContainer(tester);
await iOpenpickedWithPathAndPagecount(tester, 'test.pdf', 7);
await pdfStateIsLoaded(tester, true);
await pdfPickedPathIs(tester, 'test.pdf');
await pdfPageCountIs(tester, 7);
await pdfCurrentPageIs(tester, 1);
await pdfMarkedForSigningIs(tester, false);
});
testWidgets('''jumpTo clamps within page boundaries''', (tester) async {
await aNewProviderContainer(tester);
await aPdfIsOpenWithPathAndPagecount(tester, 'test.pdf', 5);
await iJumpto(tester, 10);
await pdfCurrentPageIs(tester, 5);
await iJumpto(tester, 0);
await pdfCurrentPageIs(tester, 1);
await iJumpto(tester, 3);
await pdfCurrentPageIs(tester, 3);
});
testWidgets('''setPageCount updates count without toggling other flags''',
(tester) async {
await aNewProviderContainer(tester);
await aPdfIsOpenWithPathAndPagecount(tester, 'test.pdf', 2);
await iToggleMark(tester);
await iSetPageCount(tester, 9);
await pdfPageCountIs(tester, 9);
await pdfStateIsLoaded(tester, true);
await pdfMarkedForSigningIs(tester, true);
});
});
}

View File

@ -1,54 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import './step/a_pdf_is_open_and_contains_at_least_one_placed_signature.dart';
import './step/the_user_savesexports_the_document.dart';
import './step/a_new_pdf_file_is_saved_at_specified_full_path_location_and_file_name.dart';
import './step/the_signatures_appear_on_the_corresponding_page_in_the_output.dart';
import './step/keep_other_unchanged_contentpages_intact_in_the_output.dart';
import './step/a_signature_is_placed_with_a_position_and_size_relative_to_the_page.dart';
import './step/the_signature_is_stamped_at_the_exact_pdf_page_coordinates_and_size.dart';
import './step/the_stamp_remains_crisp_at_any_zoom_level_not_rasterized_by_the_screen.dart';
import './step/other_page_content_remains_vector_and_unaltered.dart';
import './step/a_pdf_is_open_with_no_signatures_placed.dart';
import './step/the_user_attempts_to_save.dart';
import './step/the_user_is_notified_there_is_nothing_to_save.dart';
import './step/the_user_starts_exporting_the_document.dart';
import './step/the_export_process_is_not_yet_finished.dart';
import './step/the_user_is_notified_that_the_export_is_still_in_progress.dart';
import './step/the_user_cannot_edit_the_document.dart';
void main() {
group('''save signed PDF''', () {
testWidgets('''Export the signed document to a new file''', (tester) async {
await aPdfIsOpenAndContainsAtLeastOnePlacedSignature(tester);
await theUserSavesexportsTheDocument(tester);
await aNewPdfFileIsSavedAtSpecifiedFullPathLocationAndFileName(tester);
await theSignaturesAppearOnTheCorrespondingPageInTheOutput(tester);
await keepOtherUnchangedContentpagesIntactInTheOutput(tester);
});
testWidgets('''Vector-accurate stamping into PDF page coordinates''',
(tester) async {
await aSignatureIsPlacedWithAPositionAndSizeRelativeToThePage(tester);
await theUserSavesexportsTheDocument(tester);
await theSignatureIsStampedAtTheExactPdfPageCoordinatesAndSize(tester);
await theStampRemainsCrispAtAnyZoomLevelNotRasterizedByTheScreen(tester);
await otherPageContentRemainsVectorAndUnaltered(tester);
});
testWidgets('''Prevent saving when nothing is placed''', (tester) async {
await aPdfIsOpenWithNoSignaturesPlaced(tester);
await theUserAttemptsToSave(tester);
await theUserIsNotifiedThereIsNothingToSave(tester);
});
testWidgets('''Loading sign when exporting/saving files''', (tester) async {
await aSignatureIsPlacedWithAPositionAndSizeRelativeToThePage(tester);
await theUserStartsExportingTheDocument(tester);
await theExportProcessIsNotYetFinished(tester);
await theUserIsNotifiedThatTheExportIsStillInProgress(tester);
await theUserCannotEditTheDocument(tester);
});
});
}

View File

@ -1,59 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import './step/a_new_provider_container.dart';
import './step/signature_rect_is_null.dart';
import './step/i_place_default_signature_rect.dart';
import './step/signature_rect_left.dart';
import './step/signature_rect_top.dart';
import './step/signature_rect_right.dart';
import './step/signature_rect_bottom.dart';
import './step/signature_rect_width.dart';
import './step/signature_rect_height.dart';
import './step/a_default_signature_rect_is_placed.dart';
import './step/i_drag_signature_by.dart';
import './step/signature_rect_moved_from_center.dart';
import './step/aspect_lock_is.dart';
import './step/i_resize_signature_by.dart';
import './step/signature_aspect_ratio_is_preserved_within.dart';
void main() {
group('''Signature state logic''', () {
testWidgets('''placeDefaultRect centers a reasonable default rect''',
(tester) async {
await aNewProviderContainer(tester);
await signatureRectIsNull(tester);
await iPlaceDefaultSignatureRect(tester);
await signatureRectLeft(tester, 0);
await signatureRectTop(tester, 0);
await signatureRectRight(tester, 400);
await signatureRectBottom(tester, 560);
await signatureRectWidth(tester, 50);
await signatureRectHeight(tester, 20);
});
testWidgets('''drag clamps to canvas bounds''', (tester) async {
await aNewProviderContainer(tester);
await aDefaultSignatureRectIsPlaced(tester);
await iDragSignatureBy(tester, Offset(10000, -10000));
await signatureRectLeft(tester, 0);
await signatureRectTop(tester, 0);
await signatureRectRight(tester, 400);
await signatureRectBottom(tester, 560);
await signatureRectMovedFromCenter(tester);
});
testWidgets('''resize respects aspect lock and clamps''', (tester) async {
await aNewProviderContainer(tester);
await aDefaultSignatureRectIsPlaced(tester);
await aspectLockIs(tester, true);
await iResizeSignatureBy(tester, Offset(1000, 1000));
await signatureAspectRatioIsPreservedWithin(tester, 0.05);
await signatureRectLeft(tester, 0);
await signatureRectTop(tester, 0);
await signatureRectRight(tester, 400);
await signatureRectBottom(tester, 560);
});
});
}