alessandro trinca tornidor commited on
Commit
227730c
·
1 Parent(s): 6549b40

test: try to delete the word to add BEFORE the update, to handle dirty data cases

Browse files
static/tests/test-classic-4-lite.koboldai.net.spec.ts CHANGED
@@ -26,6 +26,11 @@ test(`test My Ghost Writer: backend request - word with no synonyms, then add a
26
  }
27
  const word = ("happy"+projectName).replace(/\s/g,'').replace(/\(/g,'').replace(/\)/g,'')
28
  console.log("word:", word, "#")
 
 
 
 
 
29
  const state = "editable"
30
  // search the word 'happy'
31
  await fillInputFieldWithString(page, word);
@@ -94,9 +99,8 @@ test(`test My Ghost Writer: backend request - word with no synonyms, then add a
94
  await ensureThesaurusPanelClosed(page);
95
 
96
  // delete the synonyms group(s) for 'happy' to ensure we can repeat this test
97
- const responseData = await deleteCustomSynonym(word)
98
- const {message} = responseData;
99
- expect(message).toContain(`Synonyms for '${word}' deleted successfully`)
100
 
101
  await page.close()
102
  })
 
26
  }
27
  const word = ("happy"+projectName).replace(/\s/g,'').replace(/\(/g,'').replace(/\)/g,'')
28
  console.log("word:", word, "#")
29
+ let responseData = null;
30
+ try {
31
+ responseData = await deleteCustomSynonym(word)
32
+ console.log("message:", responseData.message, "#")
33
+ } catch {}
34
  const state = "editable"
35
  // search the word 'happy'
36
  await fillInputFieldWithString(page, word);
 
99
  await ensureThesaurusPanelClosed(page);
100
 
101
  // delete the synonyms group(s) for 'happy' to ensure we can repeat this test
102
+ responseData = await deleteCustomSynonym(word)
103
+ expect(responseData.message).toContain(`Synonyms for '${word}' deleted successfully`)
 
104
 
105
  await page.close()
106
  })