File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ import ExtractNamesFromJson from "../extractNamesFromJson" ;
2+
3+ const data = [
4+ {
5+ title : "" ,
6+ media_list_data : [ ] ,
7+ string_list_data : [
8+ {
9+ href : "https://www.instagram.com/POTUS" ,
10+ value : "POTUS" ,
11+ timestamp : 2248397812 ,
12+ } ,
13+ ] ,
14+ } ,
15+ {
16+ title : "" ,
17+ media_list_data : [ ] ,
18+ string_list_data : [
19+ {
20+ href : "https://www.instagram.com/NASA" ,
21+ value : "NASA" ,
22+ timestamp : 1267694584 ,
23+ } ,
24+ ] ,
25+ } ,
26+ ] ;
27+
28+ describe ( "Extract Names Function Tests" , ( ) => {
29+ describe ( "Core Logic" , ( ) => {
30+ it ( "should return an array of usernames when a proper json is input" , ( ) => {
31+ const result = ExtractNamesFromJson ( data ) ;
32+ expect ( result ) . toEqual ( [ "POTUS" , "NASA" ] ) ;
33+ } ) ;
34+ } ) ;
35+ } ) ;
You can’t perform that action at this time.
0 commit comments