-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #936 from harshith-venkatesh-freshworks/feat/selec…
…t-options Addition of optional metaText details for Feat/select-options
- Loading branch information
Showing
3 changed files
with
53 additions
and
19 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,4 +126,29 @@ describe('fw-select-option', () => { | |
expect(metaText.email).toBe('[email protected]'); | ||
expect(metaText.mobile).toBe('123-456-7890'); | ||
}); | ||
|
||
it('should render fw-select-option with no variant and verify attributes', async () => { | ||
const page = await newE2EPage(); | ||
|
||
await page.setContent( | ||
`<fw-select-option | ||
text="This is a select option description" | ||
subText="This is selected option subtext" | ||
data-meta-text='{"name": "Author Name", "email": "[email protected]", "mobile": "123-456-7890"}'> | ||
</fw-select-option>` | ||
); | ||
|
||
await page.waitForChanges(); | ||
|
||
const text = await page.find('fw-select-option >>> .description'); | ||
expect(text).toBeTruthy(); | ||
expect(text.innerText).toBe('This is a select option description'); | ||
|
||
const metaText = await page.$eval('fw-select-option', (elm: any) => | ||
JSON.parse(elm.getAttribute('data-meta-text')) | ||
); | ||
expect(metaText.name).toBe('Author Name'); | ||
expect(metaText.email).toBe('[email protected]'); | ||
expect(metaText.mobile).toBe('123-456-7890'); | ||
}); | ||
}); |
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
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