Skip to content

Commit

Permalink
fix blockquote test for firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
BrtqKr committed Apr 24, 2024
1 parent 124d151 commit 690ddc1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
8 changes: 6 additions & 2 deletions WebExample/tests/styles.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ test.describe('markdown content styling', () => {
await testMarkdownContentStyle({styleName: 'mentionUser', style: CONSTANTS.MARKDOWN_STYLE_DEFINITIONS.mentionUser.style, page});
});

test('blockquote', async ({page}) => {
await testMarkdownContentStyle({styleName: 'blockquote', style: CONSTANTS.MARKDOWN_STYLE_DEFINITIONS.blockquote.style, page});
test('blockquote', async ({page, browserName}) => {
const blockquoteStyle = CONSTANTS.MARKDOWN_STYLE_DEFINITIONS.blockquote.style;
// Firefox border properties are serialized slightly differently
const browserStyle = browserName === 'firefox' ? blockquoteStyle.replace(' border-left-style: solid', ' border-left: 6px solid gray') : blockquoteStyle;

await testMarkdownContentStyle({styleName: 'blockquote', style: browserStyle, page});
});
});
12 changes: 1 addition & 11 deletions constants.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
const LOCAL_URL = 'http://localhost:19006/';

const EXAMPLE_CONTENT_STYLES = [
{content: 'Hello', style: null},
{content: 'world', style: 'font-weight: bold;'},
{content: 'https://expensify.com', style: 'color: blue; text-decoration: underline;'},
{content: '# Lorem ipsum', style: 'font-size: 25px; font-weight: bold;'},
{content: '`foo`', style: 'font-family: monospace; font-size: 20px; color: black; background-color: lightgray;'},
{content: '@here', style: 'color: green; background-color: lime;'},
{content: '@someone@swmansion.com', style: 'color: blue; background-color: cyan;'},
];

type MarkdownStyleDefiniton = {wrapContent?: (content: string) => string; style: string};

const MARKDOWN_STYLE_DEFINITIONS = {
Expand All @@ -33,4 +23,4 @@ const EXAMPLE_CONTENT = Object.entries(MARKDOWN_STYLE_DEFINITIONS)
const INPUT_ID = 'MarkdownInput_Example';
const INPUT_HISTORY_DEBOUNCE_TIME_MS = 150;

export {LOCAL_URL, EXAMPLE_CONTENT, EXAMPLE_CONTENT_STYLES, MARKDOWN_STYLE_DEFINITIONS, INPUT_ID, INPUT_HISTORY_DEBOUNCE_TIME_MS};
export {LOCAL_URL, EXAMPLE_CONTENT, MARKDOWN_STYLE_DEFINITIONS, INPUT_ID, INPUT_HISTORY_DEBOUNCE_TIME_MS};

0 comments on commit 690ddc1

Please sign in to comment.