Skip to content

Commit

Permalink
chore: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zhpenkov committed Jun 3, 2024
1 parent 26f6743 commit 3190289
Show file tree
Hide file tree
Showing 23 changed files with 1,256 additions and 4,302 deletions.
95 changes: 95 additions & 0 deletions packages/html/src/pivotgrid/tests/pivotgrid-cell-states.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import { PivotGridCell, PivotGridNormal, PivotGridRow, PivotGridTable, PivotGridTbody } from '..';


export default () =>(
<>
<div id="test-area" className="k-d-grid k-grid-cols-1">

<section>
<div className="k-d-flex k-flex-row k-pos-relative">
<PivotGridNormal
emptyCell={
<span className="k-pivotgrid-empty-cell k-focus" />
}
rowHeaders={
<PivotGridTable>
<colgroup>
<col />
<col />
<col />
</colgroup>
<PivotGridTbody>
<PivotGridRow hover>
<PivotGridCell as="th" rowSpan={5} toggle="up" headerTitle="Regions" headerRootCell />
<PivotGridCell as="th" colSpan={1} headerTitle="South America" />
<PivotGridCell as="th" rowSpan={1} toggle="down" headerTitle="Countries" headerRootCell />
</PivotGridRow>
<PivotGridRow selected>
<PivotGridCell as="th" colSpan={1} headerTitle="North America" />
<PivotGridCell as="th" rowSpan={1} toggle="down" headerTitle="Countries" headerRootCell />
</PivotGridRow>
<PivotGridRow hover selected>
<PivotGridCell as="th" colSpan={1} headerTitle="Europe" />
<PivotGridCell as="th" rowSpan={1} toggle="down" headerTitle="Countries" headerRootCell />
</PivotGridRow>
<PivotGridRow>
<PivotGridCell focus as="th" colSpan={1} headerTitle="Asia" />
<PivotGridCell focus as="th" rowSpan={1} toggle="down" headerTitle="Countries" headerRootCell />
</PivotGridRow>
<PivotGridRow>
<PivotGridCell selected as="th" colSpan={1} headerTitle="Africa" />
<PivotGridCell selected as="th" rowSpan={1} toggle="down" headerTitle="Countries" headerRootCell />
</PivotGridRow>
<PivotGridRow>
<PivotGridCell focus as="th" colSpan={2} headerTitle="Regions" headerRootCell headerTotalCell />
<PivotGridCell selected as="th" rowSpan={1} headerTitle="Countries" headerRootCell headerTotalCell />
</PivotGridRow>
</PivotGridTbody>
</PivotGridTable>
}
>
<PivotGridTable>
<colgroup>
<col width="200" />
<col width="200" />
<col width="200" />
</colgroup>
<PivotGridTbody>
<PivotGridRow hover>
<PivotGridCell as="td" colSpan={1} content="1847.00" />
<PivotGridCell as="td" colSpan={1} content="1488.00" />
<PivotGridCell as="td" colSpan={1} content="3335.00" totalCell />
</PivotGridRow>
<PivotGridRow selected>
<PivotGridCell as="td" colSpan={1} content="1998.00" />
<PivotGridCell as="td" colSpan={1} content="1406.00" />
<PivotGridCell as="td" colSpan={1} content="3404.00" totalCell />
</PivotGridRow>
<PivotGridRow hover selected>
<PivotGridCell as="td" colSpan={1} content="2065.00" />
<PivotGridCell as="td" colSpan={1} content="1242.00" />
<PivotGridCell as="td" colSpan={1} content="3307.00" totalCell />
</PivotGridRow>
<PivotGridRow>
<PivotGridCell as="td" colSpan={1} content="1830.00" />
<PivotGridCell focus as="td" colSpan={1} content="1579.00" />
<PivotGridCell focus as="td" colSpan={1} content="3409.00" totalCell />
</PivotGridRow>
<PivotGridRow>
<PivotGridCell as="td" colSpan={1} content="2005.00" />
<PivotGridCell selected as="td" colSpan={1} content="1441.00" />
<PivotGridCell selected as="td" colSpan={1} content="3446.00" totalCell />
</PivotGridRow>
<PivotGridRow>
<PivotGridCell as="td" colSpan={1} content="9745.00" totalCell />
<PivotGridCell as="td" colSpan={1} content="7156.00" totalCell />
<PivotGridCell as="td" colSpan={1} content="16901.00" totalCell />
</PivotGridRow>
</PivotGridTbody>
</PivotGridTable>
</PivotGridNormal>
</div>
</section>
</div>
</>
);
54 changes: 48 additions & 6 deletions packages/html/src/pivotgrid/tests/pivotgrid-column-menus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@ const styles = `
export default () =>(
<>
<style>{styles}</style>
<div id="test-area" className="k-d-grid k-grid-cols-4">

<span>Start View</span>
<span>Include Fields (list)</span>
<span>Include Fields (tree)</span>
<span>Filter Fields View</span>
<div id="test-area" className="k-d-grid k-grid-cols-3">

<section>
<span>Start View</span>
<Popup className="k-grid-columnmenu-popup">
<ColumnMenuNormal>
<ColumnMenuItemWrapper>
Expand All @@ -39,6 +35,49 @@ export default () =>(
</section>

<section>
<span>Columns Field Menu View</span>
<Popup className="k-grid-columnmenu-popup">
<ColumnMenuNormal>
<ColumnMenuItemWrapper>
<ColumnMenuItem text="Sort ascending" icon="sort-asc-small" />
<ColumnMenuItem text="Sort descending" icon="sort-desc-small" />
</ColumnMenuItemWrapper>
<ColumnMenuItemWrapper>
<ColumnMenuExpander itemText="Include fields" itemIcon="grid-layout" />
</ColumnMenuItemWrapper>
<ColumnMenuItemWrapper>
<ColumnMenuItem text="Move to Columns" icon="columns" className="k-disabled" />
<ColumnMenuItem text="Move to Rows" icon="rows" />
<ColumnMenuItem text="Move previous" icon="arrow-left" className="k-disabled" />
<ColumnMenuItem text="Move next" icon="arrow-right" />
</ColumnMenuItemWrapper>
</ColumnMenuNormal>
</Popup>
</section>

<section>
<span>Rows Field Menu View</span>
<Popup className="k-grid-columnmenu-popup">
<ColumnMenuNormal>
<ColumnMenuItemWrapper>
<ColumnMenuItem text="Sort ascending" icon="sort-asc-small" />
<ColumnMenuItem text="Sort descending" icon="sort-desc-small" />
</ColumnMenuItemWrapper>
<ColumnMenuItemWrapper>
<ColumnMenuExpander itemText="Include fields" itemIcon="grid-layout" />
</ColumnMenuItemWrapper>
<ColumnMenuItemWrapper>
<ColumnMenuItem text="Move to Columns" icon="columns" />
<ColumnMenuItem text="Move to Rows" icon="rows" className="k-disabled" />
<ColumnMenuItem text="Move previous" icon="arrow-left" className="k-disabled" />
<ColumnMenuItem text="Move next" icon="arrow-right" />
</ColumnMenuItemWrapper>
</ColumnMenuNormal>
</Popup>
</section>

<section>
<span>Include Fields (list)</span>
<Popup className="k-grid-columnmenu-popup">
<ColumnMenuNormal>
<ColumnMenuItemWrapper>
Expand Down Expand Up @@ -115,6 +154,8 @@ export default () =>(
</section>

<section>
<span>Include Fields (tree)</span>

<Popup className="k-grid-columnmenu-popup">
<ColumnMenuNormal>
<ColumnMenuItemWrapper>
Expand Down Expand Up @@ -162,6 +203,7 @@ export default () =>(
</section>

<section>
<span>Filter Fields View</span>
<Popup className="k-grid-columnmenu-popup">
<ColumnMenuNormal>
<ColumnMenuItemWrapper>
Expand Down
Loading

0 comments on commit 3190289

Please sign in to comment.