Skip to content

Commit

Permalink
test for capitalize format
Browse files Browse the repository at this point in the history
  • Loading branch information
Shopiley committed Dec 11, 2024
1 parent 22faa2c commit 8469d94
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
selectCharacters,
toggleBold,
toggleBulletList,
toggleCapitalize,
toggleChecklist,
toggleInsertCodeBlock,
toggleItalic,
Expand Down Expand Up @@ -122,6 +123,10 @@ const additionalStylesTestCases = [
applyShortcut: (page) => toggleUppercase(page),
style: 'Uppercase',
},
{
applyShortcut: (page) => toggleCapitalize(page),
style: 'Capitalize',
},
{
applyShortcut: (page) => toggleStrikethrough(page),
style: 'Strikethrough',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
moveToLineEnd,
selectCharacters,
toggleBold,
toggleCapitalize,
toggleItalic,
toggleLowercase,
toggleUnderline,
Expand Down Expand Up @@ -441,6 +442,11 @@ test.describe.parallel('TextFormatting', () => {
className: 'PlaygroundEditorTheme__textUppercase',
format: 'uppercase',
},
{
applyCapitalization: toggleCapitalize,
className: 'PlaygroundEditorTheme__textCapitalize',
format: 'capitalize',
},
];

capitalizationFormats.forEach(({className, format, applyCapitalization}) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,14 @@ export async function toggleUppercase(page) {
await page.keyboard.up('Shift');
}

export async function toggleCapitalize(page) {
await keyDownCtrlOrMeta(page);
await page.keyboard.down('Shift');
await page.keyboard.press('3');
await keyUpCtrlOrMeta(page);
await page.keyboard.up('Shift');
}

export async function toggleStrikethrough(page) {
await keyDownCtrlOrMeta(page);
await page.keyboard.down('Shift');
Expand Down

0 comments on commit 8469d94

Please sign in to comment.