-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MWPW-159091 Add analytics event for clicking a prompt card #829
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
test/blocks/prompt-card/mocks/body-template-group-more.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<main> | ||
<div> | ||
<div class="prompt-card template group"> | ||
<div> | ||
<div>Prefix</div> | ||
<div>Ask</div> | ||
</div> | ||
<div> | ||
<div>Rows</div> | ||
<div>1</div> | ||
</div> | ||
<div> | ||
<div></div> | ||
</div> | ||
<div> | ||
<div>Title</div> | ||
<div>Prompt</div> | ||
</div> | ||
<div> | ||
<div>Sum it up</div> | ||
<div>Summarize this document in 3 sentences.</div> | ||
</div> | ||
<div> | ||
<div>Organize your thoughts</div> | ||
<div>Suggest a few essay topics based on this reading that can help me get started.</div> | ||
</div> | ||
<div> | ||
<div>Refresh your memory.</div> | ||
<div>Provide 10 sample test questions that my professor could ask me.</div> | ||
</div> | ||
<div> | ||
<div>Point out tech advantages</div> | ||
<div>What are the key benefits for users of this proposed technology solution?</div> | ||
</div> | ||
<div> | ||
<div>Point out tech advantages</div> | ||
<div>What are the key benefits for users of this proposed technology solution?</div> | ||
</div> | ||
<div> | ||
<div>Shorten up the intro</div> | ||
<div>Rewrite the introduction so it has only 200 words and a Flesch reading score above 50.</div> | ||
</div> | ||
</div> | ||
<div class="section-metadata"> | ||
<div> | ||
<div>style</div> | ||
<div>Four up, xl-spacing</div> | ||
</div> | ||
<div> | ||
<div>background</div> | ||
<div>#f8f8f8</div> | ||
</div> | ||
</div> | ||
</div> | ||
</main> |
27 changes: 27 additions & 0 deletions
27
test/blocks/prompt-card/prompt-card-template-group-more.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* eslint-disable no-promise-executor-return */ | ||
/* eslint-disable compat/compat */ | ||
import { readFile } from '@web/test-runner-commands'; | ||
import { expect } from '@esm-bundle/chai'; | ||
import { delay } from '../../helpers/waitfor.js'; | ||
|
||
describe('prompt-cards using the template and group features', () => { | ||
before(async () => { | ||
document.head.innerHTML = await readFile({ path: './mocks/head.html' }); | ||
document.body.innerHTML = await readFile({ path: './mocks/body-template-group-more.html' }); | ||
await import('../../../acrobat/scripts/scripts.js'); | ||
await delay(500); | ||
await new Promise((resolve) => requestAnimationFrame(resolve)); | ||
}); | ||
|
||
it('creates prompt cards', () => { | ||
const blades = document.querySelectorAll('.prompt-card:not(.hidden)'); | ||
expect([...blades].length).to.equal(2); | ||
}); | ||
|
||
it('shows all cards after click view-all button', async () => { | ||
const button = document.querySelector('.view-all .con-button'); | ||
button.click(); | ||
const promptcards = document.querySelectorAll('.prompt-card:not(.hidden)'); | ||
expect([...promptcards].length).to.equal(6); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this remain hard coded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we have a default behavior and an option for authors to switch in case is need it?