@@ -15,7 +15,6 @@ import { ProposalListingData } from '../../utils/types';
1515describe ( 'Governance Page Sorting' , ( ) => {
1616 describe ( 'Action Required Section' , ( ) => {
1717 test ( 'should render items sorted by voting closes date ascending (closest deadline first)' , ( ) => {
18- // Pass data intentionally in unsorted order
1918 const unsortedRequests : ActionRequiredData [ ] = [
2019 {
2120 actionName : 'Action C - Latest deadline' ,
@@ -49,7 +48,6 @@ describe('Governance Page Sorting', () => {
4948 const cards = screen . getAllByTestId ( 'action-required-card' ) ;
5049 expect ( cards ) . toHaveLength ( 3 ) ;
5150
52- // Verify order: earliest deadline first
5351 const actionNames = cards . map (
5452 card => card . querySelector ( '[data-testid="action-required-action-content"]' ) ?. textContent
5553 ) ;
@@ -103,7 +101,6 @@ describe('Governance Page Sorting', () => {
103101 } ;
104102
105103 test ( 'should render items sorted by effective date ascending (closest first)' , ( ) => {
106- // Pass data intentionally in unsorted order
107104 const unsortedRequests : ProposalListingData [ ] = [
108105 {
109106 ...baseData ,
@@ -154,7 +151,7 @@ describe('Governance Page Sorting', () => {
154151 expect ( actionNames [ 2 ] ) . toBe ( 'Action C - Latest effective' ) ;
155152 } ) ;
156153
157- test ( 'should place Threshold items after items with specific effective dates ' , ( ) => {
154+ test ( 'should sort Threshold items by their voting deadline alongside dated items ' , ( ) => {
158155 const unsortedRequests : ProposalListingData [ ] = [
159156 {
160157 ...baseData ,
@@ -192,9 +189,8 @@ describe('Governance Page Sorting', () => {
192189 row => row . querySelector ( '[data-testid="inflight-votes-row-action-name"]' ) ?. textContent
193190 ) ;
194191
195- // Dated items should come before Threshold items
196- expect ( actionNames [ 0 ] ) . toBe ( 'Dated Action' ) ;
197- expect ( actionNames [ 1 ] ) . toBe ( 'Threshold Action' ) ;
192+ expect ( actionNames [ 0 ] ) . toBe ( 'Threshold Action' ) ;
193+ expect ( actionNames [ 1 ] ) . toBe ( 'Dated Action' ) ;
198194 } ) ;
199195
200196 test ( 'should sort multiple Threshold items by voting deadline' , ( ) => {
@@ -260,7 +256,6 @@ describe('Governance Page Sorting', () => {
260256 } ;
261257
262258 test ( 'should render items sorted by effective date descending (most recent first)' , ( ) => {
263- // Pass data intentionally in unsorted order
264259 const unsortedRequests : ProposalListingData [ ] = [
265260 {
266261 ...baseData ,
@@ -349,7 +344,6 @@ describe('Governance Page Sorting', () => {
349344 row => row . querySelector ( '[data-testid="vote-history-row-action-name"]' ) ?. textContent
350345 ) ;
351346
352- // Later time should come first (most recent)
353347 expect ( actionNames [ 0 ] ) . toBe ( 'Action B - Later time' ) ;
354348 expect ( actionNames [ 1 ] ) . toBe ( 'Action A - Earlier time' ) ;
355349 } ) ;
0 commit comments