99 overridesFromBody ,
1010 overridesFromForm ,
1111 profileUrl ,
12- yearMonth ,
1312} from '../src/lib/openprofile.js' ;
1413import { claimVerdict , isOwner , linksBack } from '../src/lib/profileAuth.js' ;
1514import { principalFromToken } from '../src/lib/openaccess.js' ;
@@ -57,10 +56,9 @@ const TOPICS = new Map([
5756 [ 'f1' , [ 'history' , 'mathematics' ] ] ,
5857 [ 'f2' , [ 'mathematics' , 'writing' ] ] ,
5958] ) ;
60- const FIRST = new Map ( [ [ 'f1' , '2024-11-15T00:00:00.000Z' ] ] ) ;
6159
6260test ( 'the generated file says what the author published, and nothing they did not' , ( ) => {
63- const doc = generateAuthorProfile ( { person : ADA , feeds : FEEDS , topicsByFeed : TOPICS , firstByFeed : FIRST , base : BASE } ) ;
61+ const doc = generateAuthorProfile ( { person : ADA , feeds : FEEDS , topicsByFeed : TOPICS , base : BASE } ) ;
6462
6563 assert . equal ( doc . name , 'Ada Lovelace' ) ;
6664 const identity = Object . fromEntries ( doc . identity . map ( ( e ) => [ e . key , e . value ] ) ) ;
@@ -84,12 +82,12 @@ test('the generated file says what the author published, and nothing they did no
8482 Show : 'The Analytical Engine' ,
8583 Kind : 'podcast' ,
8684 Language : 'en' ,
87- Since : '2024-11' ,
8885 Feed : 'https://ada.example/podcast/feed.xml' ,
8986 Listen : 'https://ada.example/podcast' ,
9087 Topics : 'history, mathematics' ,
9188 } ) ;
9289 assert . equal ( 'Seeking' in shows [ 0 ] , false ) ;
90+ assert . equal ( 'Since' in shows [ 0 ] , false , 'the feed window is not when the show started' ) ;
9391 assert . equal ( doc . sections . some ( ( s ) => s . name === 'guest' ) , false , 'no Guest section unless the person wrote one' ) ;
9492
9593 const links = doc . sections . find ( ( s ) => s . name === 'links' ) ;
@@ -98,7 +96,7 @@ test('the generated file says what the author published, and nothing they did no
9896
9997test ( 'two owned shows become ### groups in one Broadcast section' , ( ) => {
10098 const feeds = [ FEEDS [ 0 ] , { ...FEEDS [ 2 ] , role : 'owner' } ] ;
101- const doc = generateAuthorProfile ( { person : ADA , feeds, topicsByFeed : TOPICS , firstByFeed : FIRST , base : BASE } ) ;
99+ const doc = generateAuthorProfile ( { person : ADA , feeds, topicsByFeed : TOPICS , base : BASE } ) ;
102100 const shows = broadcasts ( doc ) ;
103101 assert . deepEqual ( shows . map ( ( s ) => s . Show ) , [ 'The Analytical Engine' , 'Somebody Elses Show' ] ) ;
104102 assert . equal ( shows [ 1 ] . Listen , `${ BASE } /other-show` , 'a show with no site listens on its directory page' ) ;
@@ -110,7 +108,7 @@ test('the overlay wins per part, the rest stays generated, and the file round-tr
110108 identity : { Email : 'ada@example.com' , Location : 'London' , Avatar : null } ,
111109 sections : { guest : '- **Available**: yes\n- **Expertise**: early computing' , links : 'none' } ,
112110 } ;
113- const { markdown, doc } = authorProfile ( { person : ADA , feeds : FEEDS , topicsByFeed : TOPICS , firstByFeed : FIRST , base : BASE , overrides } ) ;
111+ const { markdown, doc } = authorProfile ( { person : ADA , feeds : FEEDS , topicsByFeed : TOPICS , base : BASE , overrides } ) ;
114112 assert . equal ( doc . headline , 'Countess, programmer.' ) ;
115113 const identity = Object . fromEntries ( doc . identity . map ( ( e ) => [ e . key , e . value ] ) ) ;
116114 assert . equal ( identity . Email , 'ada@example.com' , 'the owner chose to publish it' ) ;
@@ -125,7 +123,7 @@ test('the overlay wins per part, the rest stays generated, and the file round-tr
125123} ) ;
126124
127125test ( 'a PUT body as Markdown becomes the whole overlay; as JSON it is a patch' , ( ) => {
128- const generated = generateAuthorProfile ( { person : ADA , feeds : FEEDS , topicsByFeed : TOPICS , firstByFeed : FIRST , base : BASE } ) ;
126+ const generated = generateAuthorProfile ( { person : ADA , feeds : FEEDS , topicsByFeed : TOPICS , base : BASE } ) ;
129127
130128 const edited = '# Ada Lovelace\n\n- Kind: person\n- Web: https://ada.example\n\nCountess.\n\n## Guest\n\n- **Available**: yes\n' ;
131129 const fromMd = overridesFromBody ( { contentType : 'text/markdown; charset=utf-8' , text : edited , existing : null , generated } ) ;
@@ -235,7 +233,5 @@ test('an OpenAccess token yields a principal with scopes and an email when the h
235233} ) ;
236234
237235test ( 'small helpers' , ( ) => {
238- assert . equal ( yearMonth ( '2024-11-15T00:00:00Z' ) , '2024-11' ) ;
239- assert . equal ( yearMonth ( null ) , null ) ;
240236 assert . equal ( profileUrl ( BASE , 'ada lovelace' ) , `${ BASE } /authors/ada%20lovelace/openprofile.md` ) ;
241237} ) ;
0 commit comments