Skip to content

Commit

Permalink
test(e2e): last prompt on text transformation actions on AI Block
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Aug 2, 2024
1 parent 4a27726 commit 6b2b07a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/blocks/test/e2e/blocks/ai-block.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,16 @@ test.describe( 'AI Block', () => {
await expect( page.getByText( 'Discover the Next Frontier' ).nth( 0 ) ).toBeVisible(); // The header in the AI block content.
await expect( page.getByText( 'Discover the Next Frontier' ).nth( 1 ) ).toBeVisible(); // The header inserted below.
});

test( 'use last prompt on text transform actions from history list', async({ editor, page }) => {
const aiBlock = await editor.insertBlock({
name: 'themeisle-blocks/content-generator',
attributes: {
promptID: 'textTransformation',
resultHistory: [{ result: '\u003ch2\u003eUnlock the Power of Words\u003c/h2\u003e\n\u003cp\u003eAre you ready to captivate your audience and drive conversions like never before? Let me weave magic with words that resonate, inspire, and persuade. From attention-grabbing headlines to compelling calls-to-action, I\'ve got you covered. Let\'s elevate your content and unleash its full potential.\u003c/p\u003e', meta: { usedToken: 380, prompt: 'Expand or elaborate on the following: Make a nice text' }}]
}
});

await expect( page.getByText( 'Expand or elaborate on the following: Make a nice text' ) ).toBeVisible();
});
});

0 comments on commit 6b2b07a

Please sign in to comment.