This is an automated email from the ASF dual-hosted git repository.

zehnder pushed a commit to branch 
2855-issue-with-deletetransformationrule-in-adapter
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to 
refs/heads/2855-issue-with-deletetransformationrule-in-adapter by this push:
     new f1e2ac0875 fix(#2855): Add e2e test to reproduce the bug
f1e2ac0875 is described below

commit f1e2ac087575dd31e820d2a7ae94a6b7fae283c9
Author: Philipp Zehnder <[email protected]>
AuthorDate: Mon May 13 10:26:24 2024 +0200

    fix(#2855): Add e2e test to reproduce the bug
---
 .../connect/deleteTransformationRule/input.csv     |  2 +
 .../support/utils/ConnectEventSchemaUtils.ts       |  2 +-
 .../adapter/rules/deleteTransformationRule.spec.ts | 43 ++++++++++++++++++++++
 .../event-schema-preview.component.html            |  1 +
 4 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/ui/cypress/fixtures/connect/deleteTransformationRule/input.csv 
b/ui/cypress/fixtures/connect/deleteTransformationRule/input.csv
new file mode 100644
index 0000000000..5280fe3838
--- /dev/null
+++ b/ui/cypress/fixtures/connect/deleteTransformationRule/input.csv
@@ -0,0 +1,2 @@
+timestamp;reserved bit;reserved bit_1;reserved bit_2
+1715356080000;true;true;true
diff --git a/ui/cypress/support/utils/ConnectEventSchemaUtils.ts 
b/ui/cypress/support/utils/ConnectEventSchemaUtils.ts
index 1d933399ff..495a47c738 100644
--- a/ui/cypress/support/utils/ConnectEventSchemaUtils.ts
+++ b/ui/cypress/support/utils/ConnectEventSchemaUtils.ts
@@ -178,7 +178,7 @@ export class ConnectEventSchemaUtils {
     }
 
     public static deleteProperty(propertyName: string) {
-        cy.dataCy('delete-property-' + propertyName, { timeout: 10000 })
+        cy.dataCy('"delete-property-' + propertyName + '"', { timeout: 10000 })
             .children()
             .click({ force: true });
         cy.dataCy('connect-schema-delete-properties-btn', {
diff --git a/ui/cypress/tests/adapter/rules/deleteTransformationRule.spec.ts 
b/ui/cypress/tests/adapter/rules/deleteTransformationRule.spec.ts
new file mode 100644
index 0000000000..f1b9f2b69c
--- /dev/null
+++ b/ui/cypress/tests/adapter/rules/deleteTransformationRule.spec.ts
@@ -0,0 +1,43 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+import { ConnectUtils } from '../../../support/utils/connect/ConnectUtils';
+import { FileManagementUtils } from 
'../../../support/utils/FileManagementUtils';
+import { ConnectEventSchemaUtils } from 
'../../../support/utils/ConnectEventSchemaUtils';
+
+describe('Connect delete rule transformation', () => {
+    beforeEach('Setup Test', () => {
+        cy.initStreamPipesTest();
+        
FileManagementUtils.addFile('connect/deleteTransformationRule/input.csv');
+    });
+
+    it('Perform Test', () => {
+        ConnectUtils.setUpPreprocessingRuleTest();
+
+        ConnectEventSchemaUtils.deleteProperty('reserved bit');
+        ConnectEventSchemaUtils.deleteProperty('reserved bit_1');
+        ConnectEventSchemaUtils.deleteProperty('reserved bit_2');
+
+
+        cy.dataCy('schema-preview-result-event')
+            .should(
+                'have.text',
+                '{\n"timestamp": 1715356080000\n}'
+            );
+    });
+});
+
diff --git 
a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-preview/event-schema-preview.component.html
 
b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-preview/event-schema-preview.component.html
index 41d8e5446c..41ae59c67b 100644
--- 
a/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-preview/event-schema-preview.component.html
+++ 
b/ui/src/app/connect/components/adapter-configuration/schema-editor/event-schema-preview/event-schema-preview.component.html
@@ -49,6 +49,7 @@
             <pre
                 [innerHTML]="desiredField | jsonpretty"
                 class="preview-text"
+                data-cy="schema-preview-result-event"
             ></pre>
         </sp-basic-inner-panel>
     </div>

Reply via email to