@@ -17,6 +17,16 @@ describe("endpoint-media/lib/post-type-discovery", () => {
17
17
assert . equal ( result , "note" ) ;
18
18
} ) ;
19
19
20
+ it ( "Discovers note post type (with an empty title)" , ( ) => {
21
+ const result = getPostType ( postTypes , {
22
+ type : "entry" ,
23
+ name : "" ,
24
+ content : "Note content" ,
25
+ } ) ;
26
+
27
+ assert . equal ( result , "note" ) ;
28
+ } ) ;
29
+
20
30
it ( "Discovers article post type" , ( ) => {
21
31
const result = getPostType ( postTypes , {
22
32
type : "entry" ,
@@ -88,6 +98,20 @@ describe("endpoint-media/lib/post-type-discovery", () => {
88
98
assert . equal ( result , "article" ) ;
89
99
} ) ;
90
100
101
+ it ( "Discovers article post type (content begins with name)" , ( ) => {
102
+ // Indiekit deviates from the Post Type Algorithm, which identifies a post
103
+ // as a note if the content is prefixed with the `name` value.
104
+ const result = getPostType ( postTypes , {
105
+ type : "entry" ,
106
+ name : "Article about something" ,
107
+ content : {
108
+ text : "Article about something fishy." ,
109
+ } ,
110
+ } ) ;
111
+
112
+ assert . equal ( result , "article" ) ;
113
+ } ) ;
114
+
91
115
it ( "Discovers photo post type" , ( ) => {
92
116
const result = getPostType ( postTypes , {
93
117
type : "entry" ,
0 commit comments