Skip to content

Commit

Permalink
Merge pull request #2102 from nextcloud/automated/noid/stable25-fix-n…
Browse files Browse the repository at this point in the history
…pm-audit

[stable25] Fix npm audit
  • Loading branch information
artonge authored Jan 29, 2024
2 parents afc7505 + 44bb82f commit 66aec90
Show file tree
Hide file tree
Showing 46 changed files with 286 additions and 247 deletions.
54 changes: 27 additions & 27 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/
/* eslint-disable n/no-unpublished-import */
import axios from '@nextcloud/axios'
import axios from 'axios'
import { addCommands, User } from '@nextcloud/cypress'
import { basename } from 'path'

Expand Down Expand Up @@ -85,33 +85,33 @@ Cypress.Commands.add('uploadFile', (user, fixture = 'image.jpg', mimeType = 'ima
*/
Cypress.Commands.add('uploadContent', (user, blob, mimeType, target) => {
cy.clearCookies()
.then(async () => {
const fileName = basename(target)
.then(async () => {
const fileName = basename(target)

// Process paths
const rootPath = `${Cypress.env('baseUrl')}/remote.php/dav/files/${encodeURIComponent(user.userId)}`
const filePath = target.split('/').map(encodeURIComponent).join('/')
try {
const file = new File([blob], fileName, { type: mimeType })
await axios({
url: `${rootPath}${filePath}`,
method: 'PUT',
data: file,
headers: {
'Content-Type': mimeType,
},
auth: {
username: user.userId,
password: user.password,
},
}).then(response => {
cy.log(`Uploaded content as ${fileName}`, response)
})
} catch (error) {
cy.log('error', error)
throw new Error(`Unable to process fixture`)
}
})
// Process paths
const rootPath = `${Cypress.env('baseUrl')}/remote.php/dav/files/${encodeURIComponent(user.userId)}`
const filePath = target.split('/').map(encodeURIComponent).join('/')
try {
const file = new File([blob], fileName, { type: mimeType })
await axios({
url: `${rootPath}${filePath}`,
method: 'PUT',
data: file,
headers: {
'Content-Type': mimeType,
},
auth: {
username: user.userId,
password: user.password,
},
}).then(response => {
cy.log(`Uploaded content as ${fileName}`, response)
})
} catch (error) {
cy.log('error', error)
throw new Error('Unable to process fixture')
}
})
})

Cypress.Commands.add('runOccCommand', (command: string) => {
Expand Down
4 changes: 2 additions & 2 deletions js/photos-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-main.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-public.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 66aec90

Please sign in to comment.