зеркало из https://github.com/nextcloud/spreed.git
Merge pull request #5570 from nextcloud/test/noid/messages
JS tests for Message component
This commit is contained in:
Коммит
903e5a0b10
|
@ -24,6 +24,9 @@ module.exports = {
|
|||
preset: '@vue/cli-plugin-unit-jest/presets/no-babel',
|
||||
// Allow tests in the src and in tests/unit folders
|
||||
testMatch: ['<rootDir>/src/**/*.(spec|test).(ts|js)'],
|
||||
transformIgnorePatterns: [
|
||||
'node_modules/(?!(vue-material-design-icons|@juliushaertl)/)',
|
||||
],
|
||||
resetMocks: false,
|
||||
setupFiles: ['jest-localstorage-mock'],
|
||||
setupFilesAfterEnv: [
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -329,7 +329,7 @@ export default {
|
|||
required: true,
|
||||
},
|
||||
/**
|
||||
* The conversation token.
|
||||
* The type of system message
|
||||
*/
|
||||
systemMessage: {
|
||||
type: String,
|
||||
|
@ -442,7 +442,9 @@ export default {
|
|||
},
|
||||
|
||||
isLastCallStartedMessage() {
|
||||
// FIXME: remove dependency to messages list and convert to property
|
||||
const messages = this.messagesList
|
||||
// FIXME: don't reverse the whole array as it would create a copy, just do an actual reverse search
|
||||
const lastCallStartedMessage = messages.reverse().find((message) => message.systemMessage === 'call_started')
|
||||
return lastCallStartedMessage ? (this.id === lastCallStartedMessage.id) : false
|
||||
},
|
||||
|
@ -708,6 +710,7 @@ export default {
|
|||
await this.$copyText(link)
|
||||
showSuccess(t('spreed', 'Message link copied to clipboard.'))
|
||||
} catch (error) {
|
||||
console.error('Error copying link: ', error)
|
||||
showError(t('spreed', 'The link could not be copied.'))
|
||||
}
|
||||
},
|
||||
|
|
|
@ -27,6 +27,9 @@ import Vue from 'vue'
|
|||
global.OC = {
|
||||
requestToken: '123',
|
||||
webroot: '/nc-webroot',
|
||||
config: {
|
||||
modRewriteWorking: true,
|
||||
},
|
||||
isUserAdmin() {
|
||||
return true
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче