mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	[PUI] Fix saveNotes callback (#7545)
* [PUI] Fix saveNotes callback * add delay to playwright test
This commit is contained in:
		| @@ -142,7 +142,12 @@ export default function NotesEditor({ | |||||||
|  |  | ||||||
|   // Callback to save notes to the server |   // Callback to save notes to the server | ||||||
|   const saveNotes = useCallback(() => { |   const saveNotes = useCallback(() => { | ||||||
|     const markdown = ref.current?.getMarkdown() ?? ''; |     const markdown = ref.current?.getMarkdown(); | ||||||
|  |  | ||||||
|  |     if (!noteUrl || markdown === undefined) { | ||||||
|  |       return; | ||||||
|  |     } | ||||||
|  |  | ||||||
|     api |     api | ||||||
|       .patch(noteUrl, { notes: markdown }) |       .patch(noteUrl, { notes: markdown }) | ||||||
|       .then(() => { |       .then(() => { | ||||||
|   | |||||||
| @@ -212,6 +212,7 @@ test('PUI - Pages - Part - Notes', async ({ page }) => { | |||||||
|     .fill('This is some data\n'); |     .fill('This is some data\n'); | ||||||
|  |  | ||||||
|   // Save |   // Save | ||||||
|  |   await page.waitForTimeout(1000); | ||||||
|   await page.getByLabel('save-notes').click(); |   await page.getByLabel('save-notes').click(); | ||||||
|   await page.getByText('Notes saved successfully').waitFor(); |   await page.getByText('Notes saved successfully').waitFor(); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user