mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Refactor isMac to a utility module (#22829)
GitOrigin-RevId: c6ab1dbeb1c56c35af121e7f657325a89fc847ea
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ import { EditorProviders } from '../../../helpers/editor-providers'
|
||||
import CodemirrorEditor from '../../../../../frontend/js/features/source-editor/components/codemirror-editor'
|
||||
import { mockScope } from '../helpers/mock-scope'
|
||||
import { TestContainer } from '../helpers/test-container'
|
||||
const isMac = /Mac/.test(window.navigator?.platform)
|
||||
import { isMac } from '@/shared/utils/os'
|
||||
|
||||
describe('Cursor and active line highlight', function () {
|
||||
const content = `line 1
|
||||
|
||||
+1
-2
@@ -3,8 +3,7 @@ import { EditorProviders } from '../../../helpers/editor-providers'
|
||||
import CodemirrorEditor from '../../../../../frontend/js/features/source-editor/components/codemirror-editor'
|
||||
import { mockScope } from '../helpers/mock-scope'
|
||||
import { TestContainer } from '../helpers/test-container'
|
||||
|
||||
const isMac = /Mac/.test(window.navigator?.platform)
|
||||
import { isMac } from '@/shared/utils/os'
|
||||
|
||||
const mountEditor = (content: string) => {
|
||||
const scope = mockScope(content)
|
||||
|
||||
+1
-2
@@ -3,8 +3,7 @@ import { EditorProviders } from '../../../helpers/editor-providers'
|
||||
import CodemirrorEditor from '../../../../../frontend/js/features/source-editor/components/codemirror-editor'
|
||||
import { mockScope } from '../helpers/mock-scope'
|
||||
import { TestContainer } from '../helpers/test-container'
|
||||
|
||||
const isMac = /Mac/.test(window.navigator?.platform)
|
||||
import { isMac } from '@/shared/utils/os'
|
||||
|
||||
const selectAll = () => {
|
||||
cy.get('.cm-content').trigger(
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
const isMac = /Mac/.test(window.navigator?.platform)
|
||||
import { isMac } from '@/shared/utils/os'
|
||||
|
||||
export const metaKey = isMac ? 'meta' : 'ctrl'
|
||||
|
||||
Reference in New Issue
Block a user