import ankifyEntryData from './ankifyEntryData.js';

const ankifySenseData = ({ankifyExampleData, headword}) => senseData => `${headword}#${senseData.definition}`;
const ankifyExampleData = () => {};
const headword = 'headword';
const entryData = {
  senses: [
    {
      definition: 'first definition',
      examples: []
    },
    {
      definition: 'second definition',
      examples: []
    }
  ]
};

const ankiCards =
  'headword#first definition' +
  '\n' +
  'headword#second definition';

describe('ankifyEntryData', () => {
  it('composes correct ankiCards ', () => {
    expect(
      ankifyEntryData({ankifySenseData, ankifyExampleData, headword}, entryData)
    ).toBe(ankiCards);
  });
});

@@ -125,40 +125,29 @@
  %60$%7B
-headword%7D#$%7BsenseData.definition
+senseData%7D $%7Bheadword
 %7D%60;%0A
@@ -251,143 +251,30 @@
     
-%7B%0A      definition: 'first definition',%0A      examples: %5B%5D%0A    %7D,%0A    %7B%0A      definition: 'second definition',%0A      examples: %5B%5D%0A    %7D
+'sense1',%0A    'sense2'
 %0A  %5D
@@ -299,24 +299,31 @@
 ds =%0A  '
+sense1 
 headword
 #first d
@@ -318,25 +318,8 @@
 word
-#first definition
 ' +%0A
@@ -330,24 +330,31 @@
 n' +%0A  '
+sense2 
 headword
 #second 
@@ -349,26 +349,8 @@
 word
-#second definition
 ';%0A%0A

simplify ankifyEntryData test