Skip to content

Commit

Permalink
Add test to filter and read records with non ASCII symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
Drakonian committed Mar 6, 2025
1 parent 1af700d commit 5a67979
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "e28d62da-ceb0-46e7-9e06-774bc46f4bac",
"name": "Data Editor Tool",
"publisher": "Volodymyr Dvernytskyi",
"version": "4.0.0.5",
"version": "4.0.0.6",
"brief": "https://vld-bc.com/",
"description": "https://vld-bc.com/",
"privacyStatement": "https://vld-bc.com/",
Expand Down
51 changes: 51 additions & 0 deletions Test/Tests/Cod81101.TDETBasicOperations.al
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,48 @@ codeunit 81101 "TDET Basic Operations"
Assert.RecordIsEmpty(Customer);
end;

[Test]
[HandlerFunctions('SetCustomerFilter')]
[TransactionModel(TransactionModel::AutoRollback)]
procedure FilterWithNonASCIISymbols()
var
Customer: Record Customer;
DataEditorBufferTestMode: Codeunit "TDET DE Buffer Test Mode";
DataEditor: TestPage "DET Data Editor";
DataEditorBuffer: TestPage "DET Data Editor Buffer";
ListOfRecorIds: List of [RecordId];
FieldNoFilter: List of [Integer];
UTF8String: Text[100];
begin
Init();
Customer.DeleteAll();

UTF8String := '☀Ü☁';

LibrarySales.CreateCustomer(Customer);
Customer.Name := UTF8String;
Customer.Modify(true);

ListOfRecorIds.Add(Customer.RecordId());

DataEditorBuffer.Trap();

LibraryVariableStorage.Enqueue(Customer.FieldNo(Name));
LibraryVariableStorage.Enqueue(UTF8String);

DataEditor.OpenEdit();
DataEditor.SourceTableNoField.SetValue(Database::Customer);
DataEditor.CustomTableViewField.Drilldown();
DataEditor.ExcludeFlowFieldsField.SetValue(false);
BindSubscription(DataEditorBufferTestMode);
DataEditor.OK().Invoke();
UnbindSubscription(DataEditorBufferTestMode);

Assert.AreEqual(Customer.TableCaption(), DataEditorBuffer.Caption(), '');

LibraryDataEditor.VerifyBufferFieldsWithSourceRecord(DataEditorBuffer, ListOfRecorIds, FieldNoFilter, false);
end;

[ModalPageHandler]
procedure EditICDirectionType(var NameValueLookup: TestPage "Name/Value Lookup")
begin
Expand Down Expand Up @@ -547,6 +589,15 @@ codeunit 81101 "TDET Basic Operations"
LibraryDialogHandler.HandleMessage(Message);
end;

[FilterPageHandler]
procedure SetCustomerFilter(var Record1: RecordRef): Boolean
var
FieldRefToFilter: FieldRef;
begin
FieldRefToFilter := Record1.Field(LibraryVariableStorage.DequeueInteger());
FieldRefToFilter.SetFilter(LibraryVariableStorage.DequeueText());
end;

local procedure Init()
begin
LibraryRandom.Init();
Expand Down
1 change: 0 additions & 1 deletion Test/Tests/Cod81102.TDETRecordCacheAndRefresh.al
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ codeunit 81102 "TDET Record Cache And Refresh"
LibrarySales: Codeunit "Library - Sales";
LibraryRandom: Codeunit "Library - Random";
LibraryDataEditor: Codeunit "TDET Library - Data Editor";
LibraryDialogHandler: Codeunit "Library - Dialog Handler";
LibraryVariableStorage: Codeunit "Library - Variable Storage";
Assert: Codeunit "Library Assert";

Expand Down
Binary file modified Test/Volodymyr Dvernytskyi_Data Editor Tool - Tests_1.0.0.0.app
Binary file not shown.
Binary file modified Volodymyr Dvernytskyi_Data Editor Tool_Latest.app
Binary file not shown.

0 comments on commit 5a67979

Please sign in to comment.