@@ -38,6 +38,7 @@ test('mapRowsToItems reads row dataset fields', () => {
3838 'data-state' : 'published' ,
3939 'data-title' : 'test title' ,
4040 'data-number' : '0001' ,
41+ 'data-created' : '2025-12-01T00:00:00.000Z' ,
4142 'data-updated' : '2026-01-01T00:00:00.000Z' ,
4243 'data-comment-count' : '3' ,
4344 'data-labels' : 'public docs' ,
@@ -50,6 +51,7 @@ test('mapRowsToItems reads row dataset fields', () => {
5051 assert . equal ( items [ 0 ] . state , 'published' ) ;
5152 assert . equal ( items [ 0 ] . title , 'test title' ) ;
5253 assert . equal ( items [ 0 ] . number , '0001' ) ;
54+ assert . equal ( items [ 0 ] . createdAt , '2025-12-01T00:00:00.000Z' ) ;
5355 assert . equal ( items [ 0 ] . updatedAt , '2026-01-01T00:00:00.000Z' ) ;
5456 assert . equal ( items [ 0 ] . commentCount , 3 ) ;
5557 assert . equal ( items [ 0 ] . labels , 'public docs' ) ;
@@ -110,6 +112,7 @@ test('controller loads index for search and maps matches back to rows', async ()
110112 return [
111113 {
112114 number : '0001' ,
115+ createdAt : '2025-12-01T00:00:00.000Z' ,
113116 updatedAt : '2026-01-01T00:00:00.000Z' ,
114117 commentCount : 2 ,
115118 state : 'discussion' ,
@@ -196,6 +199,7 @@ test('controller tolerates matched item without resolvable row and noResults nul
196199 loadSearchIndex : async ( ) => [
197200 {
198201 number : '9999' ,
202+ createdAt : '2025-11-30T00:00:00.000Z' ,
199203 updatedAt : '2026-01-01T00:00:00.000Z' ,
200204 commentCount : 1 ,
201205 state : 'discussion' ,
@@ -290,8 +294,8 @@ test('controller toggles noResults when zero items match', async () => {
290294
291295test ( 'controller sorts matched rows by selected sort key' , async ( ) => {
292296 const rows = [
293- makeRow ( { 'data-state' : 'discussion' , 'data-title' : 'beta' , 'data-number' : '0002' , 'data-updated' : '2026-01-02T00:00:00.000Z' , 'data-comment-count' : '5' , 'data-labels' : 'public' , 'data-author' : 'a' } ) ,
294- makeRow ( { 'data-state' : 'discussion ' , 'data-title' : 'alpha' , 'data-number' : '0001' , 'data-updated' : '2026-01-03T00:00:00.000Z' , 'data-comment-count' : '1' , 'data-labels' : 'public' , 'data-author' : 'a' } ) ,
297+ makeRow ( { 'data-state' : 'discussion' , 'data-title' : 'beta' , 'data-number' : '0002' , 'data-created' : '2026-01-03T00:00:00.000Z' , 'data- updated' : '2026-01-02T00:00:00.000Z' , 'data-comment-count' : '5' , 'data-labels' : 'public' , 'data-author' : 'a' } ) ,
298+ makeRow ( { 'data-state' : 'committed ' , 'data-title' : 'alpha' , 'data-number' : '0001' , 'data-created' : '2026-01-01T00:00:00.000Z ', 'data-updated' : '2026-01-03T00:00:00.000Z' , 'data-comment-count' : '1' , 'data-labels' : 'public' , 'data-author' : 'a' } ) ,
295299 ] ;
296300 const rowItems = mapRowsToItems ( rows ) ;
297301 const appended : string [ ] = [ ] ;
@@ -328,6 +332,22 @@ test('controller sorts matched rows by selected sort key', async () => {
328332 controller . setSortKey ( 'comments-asc' ) ;
329333 await controller . applyFilters ( ) ;
330334 assert . deepEqual ( appended . slice ( - 2 ) , [ '0001' , '0002' ] ) ;
335+
336+ controller . setSortKey ( 'created-desc' ) ;
337+ await controller . applyFilters ( ) ;
338+ assert . deepEqual ( appended . slice ( - 2 ) , [ '0002' , '0001' ] ) ;
339+
340+ controller . setSortKey ( 'created-asc' ) ;
341+ await controller . applyFilters ( ) ;
342+ assert . deepEqual ( appended . slice ( - 2 ) , [ '0001' , '0002' ] ) ;
343+
344+ controller . setSortKey ( 'state-asc' ) ;
345+ await controller . applyFilters ( ) ;
346+ assert . deepEqual ( appended . slice ( - 2 ) , [ '0001' , '0002' ] ) ;
347+
348+ controller . setSortKey ( 'state-desc' ) ;
349+ await controller . applyFilters ( ) ;
350+ assert . deepEqual ( appended . slice ( - 2 ) , [ '0002' , '0001' ] ) ;
331351} ) ;
332352
333353test ( 'initIndexPage returns null when root is missing' , ( ) => {
@@ -412,6 +432,7 @@ test('initIndexPage wires events and drives controller', async () => {
412432 json : async ( ) => [
413433 {
414434 number : '0001' ,
435+ createdAt : '2025-12-01T00:00:00.000Z' ,
415436 updatedAt : '2026-01-01T00:00:00.000Z' ,
416437 commentCount : 1 ,
417438 state : 'discussion' ,
0 commit comments