Merge pull request #3495 from overleaf/ae-prettier-2

Upgrade Prettier to v2

GitOrigin-RevId: 85aa3fa1acb6332c4f58c46165a43d1a51471f33
This commit is contained in:
Alf Eaton
2021-04-15 02:05:22 +00:00
committed by Copybot
parent 930d7ba028
commit 1ebc8a79cb
582 changed files with 20382 additions and 20374 deletions
@@ -9,19 +9,19 @@ import FileTreeCreateNameInput from '../../../../../../frontend/js/features/file
import FileTreeContext from '../../../../../../frontend/js/features/file-tree/components/file-tree-context'
import FileTreeCreateNameProvider from '../../../../../../frontend/js/features/file-tree/contexts/file-tree-create-name'
describe('<FileTreeCreateNameInput/>', function() {
describe('<FileTreeCreateNameInput/>', function () {
const sandbox = sinon.createSandbox()
beforeEach(function() {
beforeEach(function () {
sandbox.spy(window, 'requestAnimationFrame')
})
afterEach(function() {
afterEach(function () {
sandbox.restore()
cleanup()
})
it('renders an empty input', async function() {
it('renders an empty input', async function () {
render(
<FileTreeContext {...contextProps}>
<FileTreeCreateNameProvider>
@@ -34,7 +34,7 @@ describe('<FileTreeCreateNameInput/>', function() {
await screen.getByPlaceholderText('File Name')
})
it('renders a custom label and placeholder', async function() {
it('renders a custom label and placeholder', async function () {
render(
<FileTreeContext {...contextProps}>
<FileTreeCreateNameProvider>
@@ -50,7 +50,7 @@ describe('<FileTreeCreateNameInput/>', function() {
await screen.getByPlaceholderText('Enter a file name…')
})
it('uses an initial name', async function() {
it('uses an initial name', async function () {
render(
<FileTreeContext {...contextProps}>
<FileTreeCreateNameProvider initialName="test.tex">
@@ -63,7 +63,7 @@ describe('<FileTreeCreateNameInput/>', function() {
expect(input.value).to.equal('test.tex')
})
it('focuses the name', async function() {
it('focuses the name', async function () {
render(
<FileTreeContext {...contextProps}>
<FileTreeCreateNameProvider initialName="test.tex">
@@ -16,13 +16,13 @@ import FileTreeContext from '../../../../../../frontend/js/features/file-tree/co
import { useFileTreeActionable } from '../../../../../../frontend/js/features/file-tree/contexts/file-tree-actionable'
import { useFileTreeMutable } from '../../../../../../frontend/js/features/file-tree/contexts/file-tree-mutable'
describe('<FileTreeModalCreateFile/>', function() {
afterEach(function() {
describe('<FileTreeModalCreateFile/>', function () {
afterEach(function () {
fetchMock.restore()
cleanup()
})
it('handles invalid file names', async function() {
it('handles invalid file names', async function () {
render(
<FileTreeContext {...contextProps}>
<OpenWithMode mode="doc" />
@@ -56,7 +56,7 @@ describe('<FileTreeModalCreateFile/>', function() {
)
})
it('displays an error when the file limit is reached', async function() {
it('displays an error when the file limit is reached', async function () {
const rootFolder = [
{
docs: Array.from({ length: 10 }, (_, index) => ({
@@ -84,7 +84,7 @@ describe('<FileTreeModalCreateFile/>', function() {
)
})
it('displays a warning when the file limit is nearly reached', async function() {
it('displays a warning when the file limit is nearly reached', async function () {
const rootFolder = [
{
docs: Array.from({ length: 9 }, (_, index) => ({
@@ -108,7 +108,7 @@ describe('<FileTreeModalCreateFile/>', function() {
screen.getByText(/This project is approaching the file limit \(\d+\/\d+\)/)
})
it('counts files in nested folders', async function() {
it('counts files in nested folders', async function () {
const rootFolder = [
{
docs: [{ _id: 'entity-1' }],
@@ -150,7 +150,7 @@ describe('<FileTreeModalCreateFile/>', function() {
screen.getByText(/This project is approaching the file limit \(\d+\/\d+\)/)
})
it('creates a new file when the form is submitted', async function() {
it('creates a new file when the form is submitted', async function () {
fetchMock.post('express:/project/:projectId/doc', () => 204)
render(
@@ -173,7 +173,7 @@ describe('<FileTreeModalCreateFile/>', function() {
).to.be.true
})
it('imports a new file from a project', async function() {
it('imports a new file from a project', async function () {
fetchMock
.get('path:/user/projects', {
projects: [
@@ -289,7 +289,7 @@ describe('<FileTreeModalCreateFile/>', function() {
).to.be.true
})
it('import from a URL when the form is submitted', async function() {
it('import from a URL when the form is submitted', async function () {
fetchMock.post('express:/project/:projectId/linked_file', () => 204)
render(
@@ -331,7 +331,7 @@ describe('<FileTreeModalCreateFile/>', function() {
})
// eslint-disable-next-line mocha/no-skipped-tests
it.skip('uploads a new file', async function() {
it.skip('uploads a new file', async function () {
fetchMock.post('express:/project/:projectId/linked_file', () => 204)
render(