-
Notifications
You must be signed in to change notification settings - Fork 3
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 #1357 from vektor-inc/fix/highlighter/rgba
【確認中】Highlighter alpha付きのカラーパレットに対応
- Loading branch information
Showing
6 changed files
with
152 additions
and
0 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
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
7 changes: 7 additions & 0 deletions
7
test/e2e-tests/specs/__snapshots__/highlighter-lightning.test.js.snap
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,7 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Lightning Highlighter Lightning Highlighter 1`] = ` | ||
"<!-- wp:paragraph --> | ||
<p><span data-color=\\"#000000\\" style=\\"background: linear-gradient(transparent 60%,rgba(0, 0, 0, 0.7) 0);\\" class=\\"vk_highlighter\\">1</span></p> | ||
<!-- /wp:paragraph -->" | ||
`; |
7 changes: 7 additions & 0 deletions
7
test/e2e-tests/specs/__snapshots__/highlighter-x-t9.test.js.snap
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,7 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`x-t9 Highlighter x-t9 Highlighter 1`] = ` | ||
"<!-- wp:paragraph --> | ||
<p><span data-color=\\"rgba(0,0,0,0.5)\\" style=\\"background: linear-gradient(transparent 60%,rgba(0,0,0,0.5) 0);\\" class=\\"vk_highlighter\\">1</span></p> | ||
<!-- /wp:paragraph -->" | ||
`; |
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,66 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { | ||
pressKeyWithModifier, | ||
createNewPost, | ||
clickBlockAppender, | ||
clickBlockToolbarButton, | ||
getEditedPostContent, | ||
activateTheme, | ||
installTheme, | ||
} from '@wordpress/e2e-test-utils'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { changeSiteLang } from '../helper/changeSiteLang'; | ||
|
||
describe( 'Lightning Highlighter', () => { | ||
let oldLanguage; | ||
beforeAll( async () => { | ||
await installTheme( 'lightning' ); | ||
await activateTheme( 'lightning' ); | ||
} ); | ||
beforeEach( async () => { | ||
oldLanguage = await changeSiteLang( 'en' ); | ||
await createNewPost(); | ||
} ); | ||
afterEach( async () => { | ||
await changeSiteLang( oldLanguage ); | ||
}); | ||
afterAll( async () => { | ||
await activateTheme( 'twentytwentytwo' ); | ||
} ); | ||
|
||
it( 'Lightning Highlighter', async () => { | ||
/** | ||
* 新しく投稿を作る | ||
*/ | ||
await createNewPost(); | ||
|
||
await clickBlockAppender(); | ||
|
||
// Add text and select to color. | ||
await page.keyboard.type( '1' ); | ||
await pressKeyWithModifier( 'primary', 'a' ); | ||
await clickBlockToolbarButton( 'More' ); | ||
|
||
const button = await page.waitForXPath( | ||
`//button[text()='Highlighter']` | ||
); | ||
// Clicks may fail if the button is out of view. Assure it is before click. | ||
await button.evaluate( ( element ) => element.scrollIntoView() ); | ||
await button.click(); | ||
|
||
const option = await page.waitForSelector( | ||
'[aria-label="Color: Black"]' | ||
); | ||
|
||
await option.click(); | ||
|
||
expect( await getEditedPostContent() ).toMatchSnapshot(); | ||
|
||
} ) | ||
|
||
}); |
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,66 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { | ||
pressKeyWithModifier, | ||
createNewPost, | ||
clickBlockAppender, | ||
clickBlockToolbarButton, | ||
getEditedPostContent, | ||
activateTheme, | ||
installTheme, | ||
} from '@wordpress/e2e-test-utils'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { changeSiteLang } from '../helper/changeSiteLang'; | ||
|
||
describe( 'x-t9 Highlighter', () => { | ||
let oldLanguage; | ||
beforeAll( async () => { | ||
await installTheme( 'x-t9' ); | ||
await activateTheme( 'x-t9' ); | ||
} ); | ||
beforeEach( async () => { | ||
oldLanguage = await changeSiteLang( 'en' ); | ||
await createNewPost(); | ||
} ); | ||
afterEach( async () => { | ||
await changeSiteLang( oldLanguage ); | ||
}); | ||
afterAll( async () => { | ||
await activateTheme( 'twentytwentytwo' ); | ||
} ); | ||
|
||
it( 'x-t9 Highlighter', async () => { | ||
/** | ||
* 新しく投稿を作る | ||
*/ | ||
await createNewPost(); | ||
|
||
await clickBlockAppender(); | ||
|
||
// Add text and select to color. | ||
await page.keyboard.type( '1' ); | ||
await pressKeyWithModifier( 'primary', 'a' ); | ||
await clickBlockToolbarButton( 'More' ); | ||
|
||
const button = await page.waitForXPath( | ||
`//button[text()='Highlighter']` | ||
); | ||
// Clicks may fail if the button is out of view. Assure it is before click. | ||
await button.evaluate( ( element ) => element.scrollIntoView() ); | ||
await button.click(); | ||
|
||
const option = await page.waitForSelector( | ||
'[aria-label="Color: Text Secondary"]' | ||
); | ||
|
||
await option.click(); | ||
|
||
expect( await getEditedPostContent() ).toMatchSnapshot(); | ||
|
||
} ) | ||
|
||
}); |