|
| 1 | +import { htmlTableData } from "../../../../../../fixtures/htmlCellInTableWidgetV2"; |
| 2 | +import { featureFlagIntercept } from "../../../../../../support/Objects/FeatureFlags"; |
| 3 | +import { |
| 4 | + agHelper, |
| 5 | + entityExplorer, |
| 6 | + propPane, |
| 7 | + table, |
| 8 | +} from "../../../../../../support/Objects/ObjectsCore"; |
| 9 | + |
| 10 | +describe( |
| 11 | + "Table Filter for HTML Cell", |
| 12 | + { tags: ["@tag.Widget", "@tag.Table"] }, |
| 13 | + function () { |
| 14 | + before(() => { |
| 15 | + featureFlagIntercept({ |
| 16 | + release_table_html_column_type_enabled: true, |
| 17 | + }); |
| 18 | + entityExplorer.DragDropWidgetNVerify("tablewidgetv2", 650, 250); |
| 19 | + propPane.EnterJSContext("Table data", JSON.stringify(htmlTableData)); |
| 20 | + }); |
| 21 | + |
| 22 | + it("1. Ensures HTML column type is available", function () { |
| 23 | + table.ReadTableRowColumnData(1, 3, "v2").then(($cellData) => { |
| 24 | + expect($cellData).to.include("Active"); |
| 25 | + }); |
| 26 | + }); |
| 27 | + |
| 28 | + it("2. Verify HTML columns are searchable", function () { |
| 29 | + table.ReadTableRowColumnData(1, 3, "v2").then(($cellData) => { |
| 30 | + expect($cellData).to.include("Active"); |
| 31 | + table.SearchTable($cellData); |
| 32 | + table.ReadTableRowColumnData(0, 3, "v2").then((afterSearch) => { |
| 33 | + expect(afterSearch).to.eq($cellData); |
| 34 | + }); |
| 35 | + }); |
| 36 | + table.RemoveSearchTextNVerify("1", "v2"); |
| 37 | + }); |
| 38 | + |
| 39 | + it("3. Verify Table Filter for HTML columns", function () { |
| 40 | + propPane.ExpandIfCollapsedSection("search\\&filters"); |
| 41 | + agHelper.AssertExistingToggleState("Allow filtering", "false"); |
| 42 | + propPane.TogglePropertyState("Allow filtering", "On"); |
| 43 | + |
| 44 | + table.OpenNFilterTable("status", "contains", "Active"); |
| 45 | + table.ReadTableRowColumnData(0, 3, "v2").then(($cellData) => { |
| 46 | + expect($cellData).to.include("Active"); |
| 47 | + }); |
| 48 | + table.RemoveFilterNVerify("1", true, true, 0, "v2"); |
| 49 | + |
| 50 | + table.OpenNFilterTable("status", "contains", "Suspended"); |
| 51 | + table.ReadTableRowColumnData(0, 3, "v2").then(($cellData) => { |
| 52 | + expect($cellData).to.include("Suspended"); |
| 53 | + }); |
| 54 | + table.RemoveFilterNVerify("1", true, true, 0, "v2"); |
| 55 | + |
| 56 | + table.OpenNFilterTable("status", "empty", ""); |
| 57 | + table.ReadTableRowColumnData(0, 0, "v2").then(($cellData) => { |
| 58 | + expect($cellData).to.include("1"); |
| 59 | + }); |
| 60 | + table.RemoveFilterNVerify("1", true, true, 0, "v2"); |
| 61 | + |
| 62 | + table.OpenNFilterTable("status", "not empty", ""); |
| 63 | + table.ReadTableRowColumnData(0, 0, "v2").then(($cellData) => { |
| 64 | + expect($cellData).to.include("2"); |
| 65 | + }); |
| 66 | + table.RemoveFilterNVerify("1", true, true, 0, "v2"); |
| 67 | + }); |
| 68 | + |
| 69 | + it("4. Verify Table sorting for HTML columns", function () { |
| 70 | + table.SortColumn("status", "asc"); |
| 71 | + table.ReadTableRowColumnData(0, 3, "v2").then(($cellData) => { |
| 72 | + expect($cellData).to.include("Active"); |
| 73 | + }); |
| 74 | + table.SortColumn("status", "desc"); |
| 75 | + table.ReadTableRowColumnData(0, 3, "v2").then(($cellData) => { |
| 76 | + expect($cellData).to.include("Suspended"); |
| 77 | + }); |
| 78 | + }); |
| 79 | + }, |
| 80 | +); |
0 commit comments