Skip to content
This repository was archived by the owner on Jan 14, 2023. It is now read-only.

Commit 37ba81f

Browse files
committed
Small fix for the markdown editor test
1 parent d1b6207 commit 37ba81f

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- checkout
2929
- restore_cache:
3030
key: dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
31-
- run: 'sudo apt install libxss-dev pkg-config'
31+
- run: 'sudo apt install libxss-dev libxext-dev libxtst6 libnss3 libgtk-3-0 libgtkextra-dev'
3232
- run:
3333
name: Install Dependencies
3434
command: 'npm install'

render/components/__tests__/MarkdownEditor.spec.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { ThemeProvider } from 'styled-components';
55
import MarkdownEditor, { MarkdownText } from '../MarkdownEditor';
66
import utils from '../../../common/utils';
77
import theme from '../../theme';
8-
import { writeFileSync } from 'fs';
98

109
describe('MarkdownEditor component', () => {
1110
afterEach(cleanup);
@@ -35,9 +34,17 @@ describe('MarkdownEditor component', () => {
3534
}
3635
});
3736

37+
let newLine;
38+
if (process.platform === 'darwin' || process.platform === 'linux') {
39+
newLine = '\n';
40+
} else {
41+
newLine = '\r\n';
42+
}
43+
3844
// it does not update the caret position, so the markdown items during tests are prepended, not appended
3945
// in reality, the value will be 'test******__~~~~\n```\n\n```\n# ## ### - 1. > [](url)![](image-url)'
40-
expect(textarea).toHaveValue('![](image-url)[](url)> 1. - ### ## # \n```\n\n```\n~~~~__******test');
46+
// eslint-disable-next-line
47+
expect(textarea).toHaveValue('![](image-url)[](url)> 1. - ### ## # ' + newLine + '```' + newLine + newLine + '```' + newLine + '~~~~__******test');
4148
});
4249

4350
it('should display the preview when such option was clicked', () => {

render/components/__tests__/Timer.spec.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { render, cleanup, fireEvent, wait } from '@testing-library/react';
2+
import { render, cleanup, fireEvent } from '@testing-library/react';
33
import '@testing-library/jest-dom/extend-expect';
44
import { Provider } from 'react-redux';
55
import configureStore from 'redux-mock-store';

0 commit comments

Comments
 (0)