Skip to content

Commit

Permalink
Decrease linter errors, keep commented tests warnings (#7581)
Browse files Browse the repository at this point in the history
* Decrease linter errors, keep commented tests warnings
  • Loading branch information
Jan authored Sep 2, 2022
1 parent af8b72f commit 50a0ba2
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion packages/web-app-external/tests/unit/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('The app provider extension', () => {
it('should show a loading spinner while loading', async () => {
const makeRequest = jest.fn(
() =>
new Promise((resolve, reject) => {
new Promise((resolve) => {
setTimeout(() => {
resolve({
ok: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ export default defineComponent({
const paramsToCreate = this.getParamsForLink(link)
if (this.isPasswordEnforcedFor(link)) {
showQuickLinkPasswordModal({ store: this.$store }, async (newPassword) => {
showQuickLinkPasswordModal({ store: this.$store }, (newPassword) => {
this.createLink({ params: { ...paramsToCreate, password: newPassword }, onError })
})
} else {
Expand All @@ -419,7 +419,7 @@ export default defineComponent({
const params = this.getParamsForLink(link)
if (!link.password && this.isPasswordEnforcedFor(link)) {
showQuickLinkPasswordModal({ store: this.$store }, async (newPassword) => {
showQuickLinkPasswordModal({ store: this.$store }, (newPassword) => {
this.updatePublicLink({ params: { ...params, password: newPassword }, onSuccess })
})
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ export default {
)
}
},
async mounted() {
mounted() {
if (this.showSpaceMembers) {
this.loadSpaceMembersTask.perform()
}
Expand Down
6 changes: 3 additions & 3 deletions packages/web-app-files/src/helpers/resource/copyMove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export const resolveFileNameDuplicate = (name, extension, existingFiles, iterati
return resolveFileNameDuplicate(name, extension, existingFiles, iteration + 1)
}

const clientListFilesInFolder = async (
const clientListFilesInFolder = (
client: any,
webDavPath: string,
depth: number,
Expand All @@ -282,7 +282,7 @@ const clientListFilesInFolder = async (
return client.files.list(webDavPath, depth, DavProperties.Default)
}

const clientMoveFilesInFolder = async (
const clientMoveFilesInFolder = (
client: any,
webDavPathSource: string,
webDavPathTarget: string,
Expand All @@ -301,7 +301,7 @@ const clientMoveFilesInFolder = async (
return client.files.move(webDavPathSource, webDavPathTarget, overwrite)
}

const clientCopyFilesInFolder = async (
const clientCopyFilesInFolder = (
client: any,
webDavPathSource: string,
webDavPathTarget: string,
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-files/src/store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default {
{ root: true }
)
},
async clearClipboardFiles(context) {
clearClipboardFiles(context) {
context.commit('CLEAR_CLIPBOARD')
},
async pasteSelectedFiles(
Expand Down
1 change: 0 additions & 1 deletion packages/web-app-files/src/views/FilesDrop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ export default defineComponent({
resolvePublicLink() {
this.loading = true
this.$client.publicFiles
.list(this.publicLinkToken, this.publicLinkPassword, DavProperties.PublicLink, '0')
.then((files) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ describe('copyMove', () => {
])('should copy and move files if no conflicts exist', async (dataSet) => {
const client = {
files: {
list: async () => {
list: () => {
return []
},
copy: jest.fn(),
move: jest.fn()
},
publicFiles: {
list: async () => {
list: () => {
return []
},
copy: jest.fn(),
Expand Down
21 changes: 12 additions & 9 deletions packages/web-app-files/tests/unit/views/FilesDrop.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@ localVue.use(GetTextPlugin, {
localVue.prototype.$client.publicFiles = {
PUBLIC_LINK_SHARE_OWNER: 'admin',
// function is mocked because it should return a promise with a list of resources
list: async () => [
{
getProperty: jest.fn((val) => {
if (val === DavProperty.PublicLinkPermission) {
return linkRoleUploaderFolder.bitmask(false)
list: () =>
new Promise((resolve) => {
resolve([
{
getProperty: jest.fn((val) => {
if (val === DavProperty.PublicLinkPermission) {
return linkRoleUploaderFolder.bitmask(false)
}
return val
})
}
return val
})
}
],
])
}),
// function takes token as an argument and is mocked because it should return some public link url
getFileUrl: (token) => `http://some-url/${token}`,
putFileContents: jest.fn()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class Provider extends EventBus implements SearchProvider {
}
}

public activate(term: string): void {
public activate(): void {
/* noop */
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ interface AppFileHandlingOptions {
publicLinkPassword: MaybeRef<string>
}

type QueryParameters = Record<string, string>
export interface AppFileHandlingResult {
getUrlForResource(r: Resource): Promise<string>
revokeUrl(url: string): void
Expand Down
4 changes: 2 additions & 2 deletions packages/web-runtime/src/container/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ export const announceUppyService = ({ vue }: { vue: VueConstructor }): void => {
* @param store
* @param router
*/
export const announceAuthService = async ({
export const announceAuthService = ({
vue,
configurationManager,
store,
Expand All @@ -315,7 +315,7 @@ export const announceAuthService = async ({
configurationManager: ConfigurationManager
store: Store<any>
router: VueRouter
}): Promise<void> => {
}): void => {
authService.initialize(configurationManager, clientService, store, router)
set(vue, '$authService', authService)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/web-runtime/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const renderSuccess = (): void => {
(state, getters) => {
return getters['runtime/auth/isUserContextReady']
},
async (newValue, oldValue) => {
() => {
// Load spaces to make them available across the application
if (store.getters.capabilities?.spaces?.enabled) {
const clientService = instance.$clientService
Expand Down

0 comments on commit 50a0ba2

Please sign in to comment.