@@ -7,7 +7,7 @@ import { beforeAll, beforeEach, describe, expect, test, vi } from 'vitest'
77
88import axios from '@nextcloud/axios'
99import * as nextcloudDialogs from '@nextcloud/dialogs'
10- import { action } from './editLocallyAction '
10+ import { action } from './openLocallyAction '
1111
1212vi . mock ( '@nextcloud/auth' )
1313vi . mock ( '@nextcloud/axios' )
@@ -25,18 +25,18 @@ beforeAll(() => {
2525 ( window as any ) . OCA = { Viewer : { open : vi . fn ( ) } }
2626} )
2727
28- describe ( 'Edit locally action conditions tests' , ( ) => {
28+ describe ( 'Open locally action conditions tests' , ( ) => {
2929 test ( 'Default values' , ( ) => {
3030 expect ( action ) . toBeInstanceOf ( FileAction )
3131 expect ( action . id ) . toBe ( 'edit-locally' )
32- expect ( action . displayName ( [ ] , view ) ) . toBe ( 'Edit locally' )
32+ expect ( action . displayName ( [ ] , view ) ) . toBe ( 'Open locally' )
3333 expect ( action . iconSvgInline ( [ ] , view ) ) . toMatch ( / < s v g .+ < \/ s v g > / )
3434 expect ( action . default ) . toBeUndefined ( )
3535 expect ( action . order ) . toBe ( 25 )
3636 } )
3737} )
3838
39- describe ( 'Edit locally action enabled tests' , ( ) => {
39+ describe ( 'Open locally action enabled tests' , ( ) => {
4040 test ( 'Enabled for file with UPDATE permission' , ( ) => {
4141 const file = new File ( {
4242 id : 1 ,
@@ -108,15 +108,15 @@ describe('Edit locally action enabled tests', () => {
108108 } )
109109} )
110110
111- describe ( 'Edit locally action execute tests' , ( ) => {
111+ describe ( 'Open locally action execute tests' , ( ) => {
112112 let spyShowDialog
113113 beforeEach ( ( ) => {
114114 vi . resetAllMocks ( )
115115 spyShowDialog = vi . spyOn ( nextcloudDialogs . Dialog . prototype , 'show' )
116116 . mockImplementation ( ( ) => Promise . resolve ( ) )
117117 } )
118118
119- test ( 'Edit locally opens proper URL' , async ( ) => {
119+ test ( 'Open locally opens proper URL' , async ( ) => {
120120 vi . spyOn ( axios , 'post' ) . mockImplementation ( async ( ) => ( {
121121 data : { ocs : { data : { token : 'foobar' } } } ,
122122 } ) )
@@ -143,7 +143,7 @@ describe('Edit locally action execute tests', () => {
143143 expect ( windowOpenSpy ) . toBeCalledWith ( 'nc://open/test@nextcloud.local/foobar.txt?token=foobar' , '_self' )
144144 } )
145145
146- test ( 'Edit locally fails and shows error' , async ( ) => {
146+ test ( 'Open locally fails and shows error' , async ( ) => {
147147 vi . spyOn ( axios , 'post' ) . mockImplementation ( async ( ) => ( { } ) )
148148 const showError = vi . spyOn ( nextcloudDialogs , 'showError' )
149149
0 commit comments