Merge pull request #3495 from overleaf/ae-prettier-2
Upgrade Prettier to v2 GitOrigin-RevId: 85aa3fa1acb6332c4f58c46165a43d1a51471f33
This commit is contained in:
+13
-13
@@ -4,7 +4,7 @@ import { screen, render } from '@testing-library/react'
|
||||
|
||||
import PreviewLogsToggleButton from '../../../../../frontend/js/features/preview/components/preview-logs-toggle-button'
|
||||
|
||||
describe('<PreviewLogsToggleButton />', function() {
|
||||
describe('<PreviewLogsToggleButton />', function () {
|
||||
function renderPreviewLogsToggleButton(
|
||||
logsState,
|
||||
onToggleLogs,
|
||||
@@ -25,27 +25,27 @@ describe('<PreviewLogsToggleButton />', function() {
|
||||
)
|
||||
}
|
||||
|
||||
describe('basic toggle functionality', function() {
|
||||
describe('basic toggle functionality', function () {
|
||||
const logsState = {
|
||||
nErrors: 0,
|
||||
nWarnings: 0
|
||||
}
|
||||
const onToggleLogs = () => {}
|
||||
it('should render a view logs button when previewing the PDF', function() {
|
||||
it('should render a view logs button when previewing the PDF', function () {
|
||||
const showLogs = false
|
||||
renderPreviewLogsToggleButton(logsState, onToggleLogs, showLogs)
|
||||
screen.getByText('View logs')
|
||||
})
|
||||
it('should render a view PDF button when viewing logs', function() {
|
||||
it('should render a view PDF button when viewing logs', function () {
|
||||
const showLogs = true
|
||||
renderPreviewLogsToggleButton(logsState, onToggleLogs, showLogs)
|
||||
screen.getByText('View PDF')
|
||||
})
|
||||
})
|
||||
describe('compile status indicator', function() {
|
||||
describe('compile status indicator', function () {
|
||||
const showLogs = false
|
||||
const onToggleLogs = () => {}
|
||||
it('should render a view logs button by default', function() {
|
||||
it('should render a view logs button by default', function () {
|
||||
const logsState = {
|
||||
nErrors: 0,
|
||||
nWarnings: 0
|
||||
@@ -54,7 +54,7 @@ describe('<PreviewLogsToggleButton />', function() {
|
||||
screen.getByText('View logs')
|
||||
})
|
||||
|
||||
it('should render the code check failed notice', function() {
|
||||
it('should render the code check failed notice', function () {
|
||||
const logsState = {
|
||||
nErrors: 1,
|
||||
nWarnings: 0
|
||||
@@ -69,7 +69,7 @@ describe('<PreviewLogsToggleButton />', function() {
|
||||
screen.getByText('Code check failed')
|
||||
})
|
||||
|
||||
it('should render an error status message when there are errors', function() {
|
||||
it('should render an error status message when there are errors', function () {
|
||||
const logsState = {
|
||||
nErrors: 1,
|
||||
nWarnings: 0
|
||||
@@ -78,7 +78,7 @@ describe('<PreviewLogsToggleButton />', function() {
|
||||
screen.getByText(`This project has errors (${logsState.nErrors})`)
|
||||
})
|
||||
|
||||
it('should render an error status message when there are both errors and warnings', function() {
|
||||
it('should render an error status message when there are both errors and warnings', function () {
|
||||
const logsState = {
|
||||
nErrors: 1,
|
||||
nWarnings: 1
|
||||
@@ -87,7 +87,7 @@ describe('<PreviewLogsToggleButton />', function() {
|
||||
screen.getByText(`This project has errors (${logsState.nErrors})`)
|
||||
})
|
||||
|
||||
it('should render a warning status message when there are warnings but no errors', function() {
|
||||
it('should render a warning status message when there are warnings but no errors', function () {
|
||||
const logsState = {
|
||||
nErrors: 0,
|
||||
nWarnings: 1
|
||||
@@ -96,7 +96,7 @@ describe('<PreviewLogsToggleButton />', function() {
|
||||
screen.getByText(`View warnings (${logsState.nWarnings})`)
|
||||
})
|
||||
|
||||
it('should render 99+ errors when there are more than 99 errors', function() {
|
||||
it('should render 99+ errors when there are more than 99 errors', function () {
|
||||
const logsState = {
|
||||
nErrors: 100,
|
||||
nWarnings: 0
|
||||
@@ -104,7 +104,7 @@ describe('<PreviewLogsToggleButton />', function() {
|
||||
renderPreviewLogsToggleButton(logsState, onToggleLogs, showLogs)
|
||||
screen.getByText('This project has errors (99+)')
|
||||
})
|
||||
it('should show the button text when prop showText=true', function() {
|
||||
it('should show the button text when prop showText=true', function () {
|
||||
const logsState = {
|
||||
nErrors: 0,
|
||||
nWarnings: 0
|
||||
@@ -113,7 +113,7 @@ describe('<PreviewLogsToggleButton />', function() {
|
||||
renderPreviewLogsToggleButton(logsState, onToggleLogs, showLogs, showText)
|
||||
expect(screen.getByText('View logs').getAttribute('style')).to.be.null
|
||||
})
|
||||
it('should not show the button text when prop showText=false', function() {
|
||||
it('should not show the button text when prop showText=false', function () {
|
||||
const logsState = {
|
||||
nErrors: 0,
|
||||
nWarnings: 0
|
||||
|
||||
Reference in New Issue
Block a user