mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
Merge pull request #3495 from overleaf/ae-prettier-2
Upgrade Prettier to v2 GitOrigin-RevId: 85aa3fa1acb6332c4f58c46165a43d1a51471f33
This commit is contained in:
@@ -5,14 +5,14 @@ import { screen, render, fireEvent } from '@testing-library/react'
|
||||
|
||||
import OutlineItem from '../../../../../frontend/js/features/outline/components/outline-item'
|
||||
|
||||
describe('<OutlineItem />', function() {
|
||||
describe('<OutlineItem />', function () {
|
||||
const jumpToLine = sinon.stub()
|
||||
|
||||
afterEach(function() {
|
||||
afterEach(function () {
|
||||
jumpToLine.reset()
|
||||
})
|
||||
|
||||
it('renders basic item', function() {
|
||||
it('renders basic item', function () {
|
||||
const outlineItem = {
|
||||
title: 'Test Title',
|
||||
line: 1
|
||||
@@ -24,7 +24,7 @@ describe('<OutlineItem />', function() {
|
||||
expect(screen.queryByRole('button', { name: 'Collapse' })).to.not.exist
|
||||
})
|
||||
|
||||
it('collapses and expands', function() {
|
||||
it('collapses and expands', function () {
|
||||
const outlineItem = {
|
||||
title: 'Parent',
|
||||
line: 1,
|
||||
@@ -44,7 +44,7 @@ describe('<OutlineItem />', function() {
|
||||
expect(screen.queryByRole('button', { name: 'Child' })).to.not.exist
|
||||
})
|
||||
|
||||
it('highlights', function() {
|
||||
it('highlights', function () {
|
||||
const outlineItem = {
|
||||
title: 'Parent',
|
||||
line: 1
|
||||
@@ -61,7 +61,7 @@ describe('<OutlineItem />', function() {
|
||||
screen.getByRole('treeitem', { current: true })
|
||||
})
|
||||
|
||||
it('highlights when has collapsed highlighted child', function() {
|
||||
it('highlights when has collapsed highlighted child', function () {
|
||||
const outlineItem = {
|
||||
title: 'Parent',
|
||||
line: 1,
|
||||
@@ -83,7 +83,7 @@ describe('<OutlineItem />', function() {
|
||||
screen.getByRole('treeitem', { name: 'Parent', current: true })
|
||||
})
|
||||
|
||||
it('click and double-click jump to location', function() {
|
||||
it('click and double-click jump to location', function () {
|
||||
const outlineItem = {
|
||||
title: 'Parent',
|
||||
line: 1
|
||||
|
||||
@@ -3,10 +3,10 @@ import { screen, render } from '@testing-library/react'
|
||||
|
||||
import OutlineList from '../../../../../frontend/js/features/outline/components/outline-list'
|
||||
|
||||
describe('<OutlineList />', function() {
|
||||
describe('<OutlineList />', function () {
|
||||
const jumpToLine = () => {}
|
||||
|
||||
it('renders items', function() {
|
||||
it('renders items', function () {
|
||||
const outline = [
|
||||
{
|
||||
title: 'Section 1',
|
||||
@@ -25,7 +25,7 @@ describe('<OutlineList />', function() {
|
||||
screen.getByRole('treeitem', { name: 'Section 2' })
|
||||
})
|
||||
|
||||
it('renders as root', function() {
|
||||
it('renders as root', function () {
|
||||
const outline = [
|
||||
{
|
||||
title: 'Section',
|
||||
@@ -38,7 +38,7 @@ describe('<OutlineList />', function() {
|
||||
screen.getByRole('tree')
|
||||
})
|
||||
|
||||
it('renders as non-root', function() {
|
||||
it('renders as non-root', function () {
|
||||
const outline = [
|
||||
{
|
||||
title: 'Section',
|
||||
|
||||
@@ -6,7 +6,7 @@ import { screen, fireEvent } from '@testing-library/react'
|
||||
import OutlinePane from '../../../../../frontend/js/features/outline/components/outline-pane'
|
||||
import { renderWithEditorContext } from '../../../helpers/render-with-context'
|
||||
|
||||
describe('<OutlinePane />', function() {
|
||||
describe('<OutlinePane />', function () {
|
||||
const jumpToLine = () => {}
|
||||
const onToggle = sinon.stub()
|
||||
const eventTracking = { sendMB: sinon.stub() }
|
||||
@@ -16,7 +16,7 @@ describe('<OutlinePane />', function() {
|
||||
}
|
||||
|
||||
let originalLocalStorage
|
||||
before(function() {
|
||||
before(function () {
|
||||
originalLocalStorage = global.localStorage
|
||||
|
||||
Object.defineProperty(global, 'localStorage', {
|
||||
@@ -27,20 +27,20 @@ describe('<OutlinePane />', function() {
|
||||
})
|
||||
})
|
||||
|
||||
afterEach(function() {
|
||||
afterEach(function () {
|
||||
onToggle.reset()
|
||||
eventTracking.sendMB.reset()
|
||||
global.localStorage.getItem.resetHistory()
|
||||
global.localStorage.setItem.resetHistory()
|
||||
})
|
||||
|
||||
after(function() {
|
||||
after(function () {
|
||||
Object.defineProperty(global, 'localStorage', {
|
||||
value: originalLocalStorage
|
||||
})
|
||||
})
|
||||
|
||||
it('renders expanded outline', function() {
|
||||
it('renders expanded outline', function () {
|
||||
const outline = [
|
||||
{
|
||||
title: 'Section',
|
||||
@@ -61,7 +61,7 @@ describe('<OutlinePane />', function() {
|
||||
screen.getByRole('tree')
|
||||
})
|
||||
|
||||
it('renders disabled outline', function() {
|
||||
it('renders disabled outline', function () {
|
||||
const outline = []
|
||||
render(
|
||||
<OutlinePane
|
||||
@@ -76,7 +76,7 @@ describe('<OutlinePane />', function() {
|
||||
expect(screen.queryByRole('tree')).to.be.null
|
||||
})
|
||||
|
||||
it('expand outline and use local storage', function() {
|
||||
it('expand outline and use local storage', function () {
|
||||
global.localStorage.getItem.returns(false)
|
||||
const outline = [
|
||||
{
|
||||
|
||||
@@ -4,10 +4,10 @@ import { screen, render } from '@testing-library/react'
|
||||
|
||||
import OutlineRoot from '../../../../../frontend/js/features/outline/components/outline-root'
|
||||
|
||||
describe('<OutlineRoot />', function() {
|
||||
describe('<OutlineRoot />', function () {
|
||||
const jumpToLine = () => {}
|
||||
|
||||
it('renders outline', function() {
|
||||
it('renders outline', function () {
|
||||
const outline = [
|
||||
{
|
||||
title: 'Section',
|
||||
@@ -21,7 +21,7 @@ describe('<OutlineRoot />', function() {
|
||||
expect(screen.queryByRole('link')).to.be.null
|
||||
})
|
||||
|
||||
it('renders placeholder', function() {
|
||||
it('renders placeholder', function () {
|
||||
const outline = []
|
||||
render(<OutlineRoot outline={outline} jumpToLine={jumpToLine} />)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user