Merge branch 'master' into 6801-fix-broken-links-in-readmes

This commit is contained in:
mahula 2023-11-01 10:04:53 +01:00 committed by GitHub
commit aa3ae9358a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 51 additions and 45 deletions

View File

@ -31,7 +31,8 @@ const { parsed } = dotenv.config({ path: '../backend/.env' })
module.exports = defineConfig({ module.exports = defineConfig({
e2e: { e2e: {
projectId: "qa7fe2", projectId: "qa7fe2",
defaultCommandTimeout: 10000, defaultCommandTimeout: 60000,
pageLoadTimeout:180000,
chromeWebSecurity: false, chromeWebSecurity: false,
baseUrl: "http://localhost:3000", baseUrl: "http://localhost:3000",
specPattern: "cypress/e2e/**/*.feature", specPattern: "cypress/e2e/**/*.feature",

View File

@ -46,7 +46,7 @@ describe('DonationInfo.vue', () => {
// it looks to me that toLocaleString for some reason is not working as expected // it looks to me that toLocaleString for some reason is not working as expected
it.skip('creates a label from the given amounts and a translation string', () => { it.skip('creates a label from the given amounts and a translation string', () => {
expect(mocks.$t).nthCalledWith(1, 'donations.amount-of-total', { expect(mocks.$t).toHaveBeenNthCalledWith(1, 'donations.amount-of-total', {
amount: '10.000', amount: '10.000',
total: '50.000', total: '50.000',
}) })
@ -55,7 +55,7 @@ describe('DonationInfo.vue', () => {
describe('given english locale', () => { describe('given english locale', () => {
it('creates a label from the given amounts and a translation string', () => { it('creates a label from the given amounts and a translation string', () => {
expect(mocks.$t).toBeCalledWith( expect(mocks.$t).toHaveBeenCalledWith(
'donations.amount-of-total', 'donations.amount-of-total',
expect.objectContaining({ expect.objectContaining({
amount: '10,000', amount: '10,000',

View File

@ -3,7 +3,7 @@
<div class="filter-menu-options"> <div class="filter-menu-options">
<div class="filter-header"> <div class="filter-header">
<h2 class="title">{{ $t('filter-menu.filter-by') }}</h2> <h2 class="title">{{ $t('filter-menu.filter-by') }}</h2>
<div class="item-save-topics"> <div v-if="categoriesActive" class="item-save-topics">
<labeled-button <labeled-button
filled filled
:label="$t('actions.saveCategories')" :label="$t('actions.saveCategories')"
@ -62,18 +62,20 @@ export default {
}, },
methods: { methods: {
saveCategories() { saveCategories() {
this.$apollo if (this.categoriesActive) {
.mutate({ this.$apollo
mutation: SaveCategories(), .mutate({
variables: { activeCategories: this.filteredCategoryIds }, mutation: SaveCategories(),
}) variables: { activeCategories: this.filteredCategoryIds },
.then(() => { })
this.$emit('showFilterMenu') .then(() => {
this.$toast.success(this.$t('filter-menu.save.success')) this.$emit('showFilterMenu')
}) this.$toast.success(this.$t('filter-menu.save.success'))
.catch(() => { })
this.$toast.error(this.$t('filter-menu.save.error')) .catch(() => {
}) this.$toast.error(this.$t('filter-menu.save.error'))
})
}
}, },
}, },
} }

View File

@ -94,20 +94,20 @@ describe('GroupMember', () => {
describe('with server error', () => { describe('with server error', () => {
it('toasts an error message', () => { it('toasts an error message', () => {
expect(toastErrorMock).toBeCalledWith('Oh no!') expect(toastErrorMock).toHaveBeenCalledWith('Oh no!')
}) })
}) })
describe('with server success', () => { describe('with server success', () => {
it('calls the API', () => { it('calls the API', () => {
expect(apolloMock).toBeCalledWith({ expect(apolloMock).toHaveBeenCalledWith({
mutation: changeGroupMemberRoleMutation(), mutation: changeGroupMemberRoleMutation(),
variables: { groupId: 'group-id', userId: 'user', roleInGroup: 'admin' }, variables: { groupId: 'group-id', userId: 'user', roleInGroup: 'admin' },
}) })
}) })
it('toasts a success message', () => { it('toasts a success message', () => {
expect(toastSuccessMock).toBeCalledWith('group.changeMemberRole') expect(toastSuccessMock).toHaveBeenCalledWith('group.changeMemberRole')
}) })
}) })
}) })
@ -150,7 +150,7 @@ describe('GroupMember', () => {
}) })
it('toasts an error message', () => { it('toasts an error message', () => {
expect(toastErrorMock).toBeCalledWith('Oh no!!') expect(toastErrorMock).toHaveBeenCalledWith('Oh no!!')
}) })
it('closes the modal', () => { it('closes the modal', () => {
@ -165,7 +165,7 @@ describe('GroupMember', () => {
}) })
it('calls the API', () => { it('calls the API', () => {
expect(apolloMock).toBeCalledWith({ expect(apolloMock).toHaveBeenCalledWith({
mutation: removeUserFromGroupMutation(), mutation: removeUserFromGroupMutation(),
variables: { groupId: 'group-id', userId: 'user' }, variables: { groupId: 'group-id', userId: 'user' },
}) })
@ -176,7 +176,7 @@ describe('GroupMember', () => {
}) })
it('toasts a success message', () => { it('toasts a success message', () => {
expect(toastSuccessMock).toBeCalledWith('group.memberRemoved') expect(toastSuccessMock).toHaveBeenCalledWith('group.memberRemoved')
}) })
it('closes the modal', () => { it('closes the modal', () => {

View File

@ -75,8 +75,8 @@ describe('LoginForm', () => {
describe('no categories saved', () => { describe('no categories saved', () => {
it('resets the categories', async () => { it('resets the categories', async () => {
await fillIn(Wrapper()) await fillIn(Wrapper())
expect(storeMocks.mutations['posts/RESET_CATEGORIES']).toBeCalled() expect(storeMocks.mutations['posts/RESET_CATEGORIES']).toHaveBeenCalled()
expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).not.toBeCalled() expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).not.toHaveBeenCalled()
}) })
}) })
@ -84,11 +84,11 @@ describe('LoginForm', () => {
it('sets the categories', async () => { it('sets the categories', async () => {
authUserMock.mockReturnValue({ activeCategories: ['cat1', 'cat9', 'cat12'] }) authUserMock.mockReturnValue({ activeCategories: ['cat1', 'cat9', 'cat12'] })
await fillIn(Wrapper()) await fillIn(Wrapper())
expect(storeMocks.mutations['posts/RESET_CATEGORIES']).toBeCalled() expect(storeMocks.mutations['posts/RESET_CATEGORIES']).toHaveBeenCalled()
expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).toBeCalledTimes(3) expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).toHaveBeenCalledTimes(3)
expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).toBeCalledWith({}, 'cat1') expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).toHaveBeenCalledWith({}, 'cat1')
expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).toBeCalledWith({}, 'cat9') expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).toHaveBeenCalledWith({}, 'cat9')
expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).toBeCalledWith({}, 'cat12') expect(storeMocks.mutations['posts/TOGGLE_CATEGORY']).toHaveBeenCalledWith({}, 'cat12')
}) })
}) })
}) })

View File

@ -73,7 +73,7 @@ describe('PostTeaser', () => {
it('has no validation errors', () => { it('has no validation errors', () => {
const spy = jest.spyOn(global.console, 'error') const spy = jest.spyOn(global.console, 'error')
Wrapper() Wrapper()
expect(spy).not.toBeCalled() expect(spy).not.toHaveBeenCalled()
spy.mockReset() spy.mockReset()
}) })

View File

@ -114,11 +114,11 @@ describe('PostIndex', () => {
}) })
it('resets the category filter', () => { it('resets the category filter', () => {
expect(mutations['posts/RESET_CATEGORIES']).toBeCalled() expect(mutations['posts/RESET_CATEGORIES']).toHaveBeenCalled()
}) })
it('sets the category', () => { it('sets the category', () => {
expect(mutations['posts/TOGGLE_CATEGORY']).toBeCalledWith({}, 'cat3') expect(mutations['posts/TOGGLE_CATEGORY']).toHaveBeenCalledWith({}, 'cat3')
}) })
}) })
}) })

View File

@ -19,7 +19,7 @@
</client-only> </client-only>
</div> </div>
<div> <div>
<div v-if="categoriesActive && SHOW_CONTENT_FILTER_MASONRY_GRID" class="top-filter-menu"> <div v-if="SHOW_CONTENT_FILTER_MASONRY_GRID" class="top-filter-menu">
<div class="filterButtonBox"> <div class="filterButtonBox">
<div class="filterButtonMenu" :class="{ 'hide-filter': hideByScroll }"> <div class="filterButtonMenu" :class="{ 'hide-filter': hideByScroll }">
<base-button <base-button

View File

@ -71,7 +71,7 @@ describe('Login.vue', () => {
asyncData = true asyncData = true
tosVersion = '0.0.4' tosVersion = '0.0.4'
wrapper = await Wrapper() wrapper = await Wrapper()
expect(redirect).toBeCalledWith('/') expect(redirect).toHaveBeenCalledWith('/')
}) })
}) })
}) })

View File

@ -36,8 +36,8 @@ describe('logout.vue', () => {
}) })
it('logs out and redirects to login', () => { it('logs out and redirects to login', () => {
expect(mocks.$store.dispatch).toBeCalledWith('auth/logout') expect(mocks.$store.dispatch).toHaveBeenCalledWith('auth/logout')
expect(mocks.$router.replace).toBeCalledWith('/login') expect(mocks.$router.replace).toHaveBeenCalledWith('/login')
}) })
}) })
}) })

View File

@ -114,19 +114,19 @@ describe('map', () => {
}) })
it('initializes on style load', () => { it('initializes on style load', () => {
expect(mapOnMock).toBeCalledWith('style.load', expect.any(Function)) expect(mapOnMock).toHaveBeenCalledWith('style.load', expect.any(Function))
}) })
it('initializes on mouseenter', () => { it('initializes on mouseenter', () => {
expect(mapOnMock).toBeCalledWith('mouseenter', 'markers', expect.any(Function)) expect(mapOnMock).toHaveBeenCalledWith('mouseenter', 'markers', expect.any(Function))
}) })
it('initializes on mouseleave', () => { it('initializes on mouseleave', () => {
expect(mapOnMock).toBeCalledWith('mouseleave', 'markers', expect.any(Function)) expect(mapOnMock).toHaveBeenCalledWith('mouseleave', 'markers', expect.any(Function))
}) })
it('calls add map control', () => { it('calls add map control', () => {
expect(mapAddControlMock).toBeCalled() expect(mapAddControlMock).toHaveBeenCalled()
}) })
describe('trigger style load event', () => { describe('trigger style load event', () => {
@ -137,7 +137,7 @@ describe('map', () => {
}) })
it('calls loadMarkersIconsAndAddMarkers', () => { it('calls loadMarkersIconsAndAddMarkers', () => {
expect(spy).toBeCalled() expect(spy).toHaveBeenCalled()
}) })
}) })

View File

@ -68,7 +68,7 @@ describe('password-reset.vue', () => {
asyncData = true asyncData = true
isLoggedIn = true isLoggedIn = true
wrapper = await Wrapper() wrapper = await Wrapper()
expect(redirect).toBeCalledWith('/') expect(redirect).toHaveBeenCalledWith('/')
}) })
}) })
}) })

View File

@ -76,7 +76,10 @@ describe('post/_id.vue', () => {
authorId = 'some-author' authorId = 'some-author'
userId = 'some-user' userId = 'some-user'
wrapper = await Wrapper() wrapper = await Wrapper()
expect(error).toBeCalledWith({ message: 'error-pages.cannot-edit-post', statusCode: 403 }) expect(error).toHaveBeenCalledWith({
message: 'error-pages.cannot-edit-post',
statusCode: 403,
})
}) })
it('renders with asyncData of same user', async () => { it('renders with asyncData of same user', async () => {

View File

@ -327,7 +327,7 @@ describe('Registration', () => {
asyncData = true asyncData = true
isLoggedIn = true isLoggedIn = true
wrapper = await Wrapper() wrapper = await Wrapper()
expect(redirect).toBeCalledWith('/') expect(redirect).toHaveBeenCalledWith('/')
}) })
// copied from webapp/components/Registration/Signup.spec.js as testing template // copied from webapp/components/Registration/Signup.spec.js as testing template

View File

@ -71,7 +71,7 @@ describe('terms-and-conditions-confirm.vue', () => {
asyncData = true asyncData = true
tosAgree = true tosAgree = true
wrapper = await Wrapper() wrapper = await Wrapper()
expect(redirect).toBeCalledWith('/') expect(redirect).toHaveBeenCalledWith('/')
}) })
}) })
}) })