Skip to content

Commit b1f009d

Browse files
Merge pull request nextcloud#52727 from nextcloud/dependabot/npm_and_yarn/nextcloud/vue-8.26.1
build(deps): bump @nextcloud/vue from 8.25.1 to 8.27.0
2 parents 899b202 + 06f89c2 commit b1f009d

224 files changed

Lines changed: 418 additions & 318 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/files/src/services/HotKeysService.spec.ts

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ describe('HotKeysService testing', () => {
6161
activeStore.setActiveNode(file)
6262

6363
window.OCA = { Files: { Sidebar: { open: () => {}, setActiveTab: () => {} } } }
64+
// We only mock what needed, we do not need Files.Router.goTo or Files.Navigation
6465
window.OCP = { Files: { Router: { goToRoute: goToRouteMock, params: {}, query: {} } } }
6566

6667
initialState = document.createElement('input')
@@ -73,56 +74,56 @@ describe('HotKeysService testing', () => {
7374
})
7475

7576
it('Pressing d should open the sidebar once', () => {
76-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'd', code: 'KeyD' }))
77+
dispatchEvent({ key: 'd', code: 'KeyD' })
7778

7879
// Modifier keys should not trigger the action
79-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'd', code: 'KeyD', ctrlKey: true }))
80-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'd', code: 'KeyD', altKey: true }))
81-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'd', code: 'KeyD', shiftKey: true }))
82-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'd', code: 'KeyD', metaKey: true }))
80+
dispatchEvent({ key: 'd', code: 'KeyD', ctrlKey: true })
81+
dispatchEvent({ key: 'd', code: 'KeyD', altKey: true })
82+
dispatchEvent({ key: 'd', code: 'KeyD', shiftKey: true })
83+
dispatchEvent({ key: 'd', code: 'KeyD', metaKey: true })
8384

8485
expect(sidebarAction.enabled).toHaveReturnedWith(true)
8586
expect(sidebarAction.exec).toHaveBeenCalledOnce()
8687
})
8788

8889
it('Pressing F2 should rename the file', () => {
89-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'F2', code: 'F2' }))
90+
dispatchEvent({ key: 'F2', code: 'F2' })
9091

9192
// Modifier keys should not trigger the action
92-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'F2', code: 'F2', ctrlKey: true }))
93-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'F2', code: 'F2', altKey: true }))
94-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'F2', code: 'F2', shiftKey: true }))
95-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'F2', code: 'F2', metaKey: true }))
93+
dispatchEvent({ key: 'F2', code: 'F2', ctrlKey: true })
94+
dispatchEvent({ key: 'F2', code: 'F2', altKey: true })
95+
dispatchEvent({ key: 'F2', code: 'F2', shiftKey: true })
96+
dispatchEvent({ key: 'F2', code: 'F2', metaKey: true })
9697

9798
expect(renameAction.enabled).toHaveReturnedWith(true)
9899
expect(renameAction.exec).toHaveBeenCalledOnce()
99100
})
100101

101102
it('Pressing s should toggle favorite', () => {
102103
vi.spyOn(axios, 'post').mockImplementationOnce(() => Promise.resolve())
103-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 's', code: 'KeyS' }))
104+
dispatchEvent({ key: 's', code: 'KeyS' })
104105

105106
// Modifier keys should not trigger the action
106-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 's', code: 'KeyS', ctrlKey: true }))
107-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 's', code: 'KeyS', altKey: true }))
108-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 's', code: 'KeyS', shiftKey: true }))
109-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 's', code: 'KeyS', metaKey: true }))
107+
dispatchEvent({ key: 's', code: 'KeyS', ctrlKey: true })
108+
dispatchEvent({ key: 's', code: 'KeyS', altKey: true })
109+
dispatchEvent({ key: 's', code: 'KeyS', shiftKey: true })
110+
dispatchEvent({ key: 's', code: 'KeyS', metaKey: true })
110111

111112
expect(favoriteAction.enabled).toHaveReturnedWith(true)
112113
expect(favoriteAction.exec).toHaveBeenCalledOnce()
113114
})
114115

115116
it('Pressing Delete should delete the file', async () => {
116-
// @ts-expect-error mocking private field
117+
// @ts-expect-error unit testing
117118
vi.spyOn(deleteAction._action, 'exec').mockResolvedValue(() => true)
118119

119-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'Delete', code: 'Delete' }))
120+
dispatchEvent({ key: 'Delete', code: 'Delete' })
120121

121122
// Modifier keys should not trigger the action
122-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'Delete', code: 'Delete', ctrlKey: true }))
123-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'Delete', code: 'Delete', altKey: true }))
124-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'Delete', code: 'Delete', shiftKey: true }))
125-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'Delete', code: 'Delete', metaKey: true }))
123+
dispatchEvent({ key: 'Delete', code: 'Delete', ctrlKey: true })
124+
dispatchEvent({ key: 'Delete', code: 'Delete', altKey: true })
125+
dispatchEvent({ key: 'Delete', code: 'Delete', shiftKey: true })
126+
dispatchEvent({ key: 'Delete', code: 'Delete', metaKey: true })
126127

127128
expect(deleteAction.enabled).toHaveReturnedWith(true)
128129
expect(deleteAction.exec).toHaveBeenCalledOnce()
@@ -132,7 +133,7 @@ describe('HotKeysService testing', () => {
132133
expect(goToRouteMock).toHaveBeenCalledTimes(0)
133134
window.OCP.Files.Router.query = { dir: '/foo/bar' }
134135

135-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowUp', code: 'ArrowUp', altKey: true }))
136+
dispatchEvent({ key: 'ArrowUp', code: 'ArrowUp', altKey: true })
136137

137138
expect(goToRouteMock).toHaveBeenCalledOnce()
138139
expect(goToRouteMock.mock.calls[0][2].dir).toBe('/foo')
@@ -145,9 +146,7 @@ describe('HotKeysService testing', () => {
145146
userConfigStore.userConfig.grid_view = false
146147
expect(userConfigStore.userConfig.grid_view).toBe(false)
147148

148-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'v', code: 'KeyV' }))
149-
await nextTick()
150-
149+
dispatchEvent({ key: 'v', code: 'KeyV' })
151150
expect(userConfigStore.userConfig.grid_view).toBe(true)
152151
})
153152

@@ -164,9 +163,19 @@ describe('HotKeysService testing', () => {
164163
userConfigStore.userConfig.grid_view = false
165164
expect(userConfigStore.userConfig.grid_view).toBe(false)
166165

167-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 'v', code: 'KeyV', [modifier]: true }))
166+
dispatchEvent(new KeyboardEvent('keydown', { key: 'v', code: 'KeyV', [modifier]: true }))
167+
168168
await nextTick()
169169

170170
expect(userConfigStore.userConfig.grid_view).toBe(false)
171171
})
172172
})
173+
174+
/**
175+
* Helper to dispatch the correct event.
176+
*
177+
* @param init - KeyboardEvent options
178+
*/
179+
function dispatchEvent(init: KeyboardEventInit) {
180+
document.body.dispatchEvent(new KeyboardEvent('keydown', { ...init, bubbles: true }))
181+
}

apps/systemtags/src/services/HotKeysService.spec.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,24 @@ describe('HotKeysService testing', () => {
4242
})
4343

4444
it('Pressing t should open the tag management dialog', () => {
45-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 't', code: 'KeyT' }))
45+
dispatchEvent({ key: 't', code: 'KeyT' })
4646

4747
// Modifier keys should not trigger the action
48-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 't', code: 'KeyT', ctrlKey: true }))
49-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 't', code: 'KeyT', altKey: true }))
50-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 't', code: 'KeyT', shiftKey: true }))
51-
window.dispatchEvent(new KeyboardEvent('keydown', { key: 't', code: 'KeyT', metaKey: true }))
48+
dispatchEvent({ key: 't', code: 'KeyT', ctrlKey: true })
49+
dispatchEvent({ key: 't', code: 'KeyT', altKey: true })
50+
dispatchEvent({ key: 't', code: 'KeyT', shiftKey: true })
51+
dispatchEvent({ key: 't', code: 'KeyT', metaKey: true })
5252

5353
expect(bulkSystemTagsAction.enabled).toHaveReturnedWith(true)
5454
expect(bulkSystemTagsAction.exec).toHaveBeenCalledOnce()
5555
})
5656
})
57+
58+
/**
59+
* Helper to dispatch the correct event.
60+
*
61+
* @param init - KeyboardEvent options
62+
*/
63+
function dispatchEvent(init: KeyboardEventInit) {
64+
document.body.dispatchEvent(new KeyboardEvent('keydown', { ...init, bubbles: true }))
65+
}

cypress/e2e/files/favorites.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe('files: Favorites', { testIsolation: true }, () => {
3030
// See action is called 'Add to favorites'
3131
cy.get('[data-cy-files-list-row-action="favorite"] > button').last()
3232
.should('exist')
33-
.and('have.text', 'Add to favorites')
33+
.and('contain.text', 'Add to favorites')
3434
.click({ force: true })
3535
cy.wait('@addToFavorites')
3636
// See favorites star

dist/1023-1023.js.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This file is generated from multiple sources. Included packages:
2828
- version: 3.0.1
2929
- license: GPL-3.0-or-later
3030
- @nextcloud/vue
31-
- version: 8.26.1
31+
- version: 8.27.0
3232
- license: AGPL-3.0-or-later
3333
- @vueuse/core
3434
- version: 11.3.0

dist/1406-1406.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/1406-1406.js.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ This file is generated from multiple sources. Included packages:
8989
- version: 3.0.1
9090
- license: GPL-3.0-or-later
9191
- @nextcloud/vue
92-
- version: 8.26.1
92+
- version: 8.27.0
9393
- license: AGPL-3.0-or-later
9494
- @vueuse/core
9595
- version: 11.3.0

dist/1406-1406.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/1656-1656.js.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ This file is generated from multiple sources. Included packages:
8181
- version: 1.10.0
8282
- license: AGPL-3.0-or-later
8383
- @nextcloud/vue
84-
- version: 8.26.1
84+
- version: 8.27.0
8585
- license: AGPL-3.0-or-later
8686
- @vueuse/core
8787
- version: 11.3.0

dist/3485-3485.js.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ This file is generated from multiple sources. Included packages:
8181
- version: 1.10.0
8282
- license: AGPL-3.0-or-later
8383
- @nextcloud/vue
84-
- version: 8.26.1
84+
- version: 8.27.0
8585
- license: AGPL-3.0-or-later
8686
- @vueuse/core
8787
- version: 11.3.0

dist/3920-3920.js.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ This file is generated from multiple sources. Included packages:
9393
- version: 3.0.1
9494
- license: GPL-3.0-or-later
9595
- @nextcloud/vue
96-
- version: 8.26.1
96+
- version: 8.27.0
9797
- license: AGPL-3.0-or-later
9898
- @vue/devtools-api
9999
- version: 6.6.3

0 commit comments

Comments
 (0)