-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/actions #1712
Feature/actions #1712
Conversation
# Conflicts: # hermes-console-vue/src/api/hermes-client/index.ts # hermes-console-vue/src/views/topic/TopicView.vue # hermes-console-vue/src/views/topic/topic-header/TopicHeader.vue
# Conflicts: # hermes-console-vue/src/views/topic/TopicView.vue
…roved search pattern regex
# Conflicts: # hermes-console-vue/json-server/server.ts # hermes-console-vue/src/api/hermes-client/index.ts # hermes-console-vue/src/main.ts # hermes-console-vue/vitest.setup.ts
const isDialogOpened = ref(isOpenedByDefault); | ||
const actionButtonEnabled = ref(actionButtonEnabledByDefault); | ||
|
||
async function openDialog() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are all these functions async
? They are not doing any asynchronous work and we are not awaiting them when they are used. I suggest we make them sync
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
import { dummyRoles } from '@/dummy/roles'; | ||
import { dummyTopic, dummyTopicOwner } from '@/dummy/topic'; | ||
import { render } from '@/utils/test-utils'; | ||
import { Role } from '@/api/role'; | ||
import TopicHeader from '@/views/topic/topic-header/TopicHeader.vue'; | ||
|
||
describe('TopicHeader', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: perhaps we should test whether remove
event is emitted on button click
|
||
const { | ||
isDialogOpened: isRemoveDialogOpened, | ||
actionButtonEnabled: actionRemoveButtonEnabled, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actionButtonEnabled: actionRemoveButtonEnabled, | |
actionButtonEnabled: removeActionButtonEnabled, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -13,6 +13,8 @@ | |||
(topic) => !props.filter || topic.includes(props.filter), | |||
); | |||
}); | |||
|
|||
defineEmits(['remove']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider using typed emits to make argument types clear: https://vuejs.org/guide/typescript/composition-api.html#typing-component-emits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -28,4 +28,5 @@ export const useNotificationsStore = defineStore('notifications', { | |||
); | |||
}, | |||
}, | |||
persist: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
@@ -68,11 +68,14 @@ export function useSearch(): UseSearch { | |||
}; | |||
} | |||
|
|||
const patternPrefix = '(?i).*'; | |||
const patternSuffix = '.*'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be confusing that user types in regex but his regex is only in the middle of our regex. But I agree that this will make life easier for average user
@@ -50,4 +66,44 @@ describe('useInconsistentTopics', () => { | |||
expect(error.value.fetchInconsistentTopics).not.toBeNull(); | |||
}); | |||
}); | |||
|
|||
it('should show message that removing subscription was successful', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it('should show message that removing subscription was successful', async () => { | |
it('should show message that removing inconsistentTopic was successful', async () => { |
@@ -1,4 +1,5 @@ | |||
import { beforeEach } from 'vitest'; | |||
import { dummyOwner } from '@/dummy/topic'; | |||
import { dummySubscription } from '@/dummy/subscription'; | |||
import { expect } from 'vitest'; | |||
import { render } from '@/utils/test-utils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: we can consider adding tests for checking whether events were emitted on btn clicks
}); | ||
}); | ||
|
||
it('should show message that removing subscription was unsuccessful', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it('should show message that removing subscription was unsuccessful', async () => { | |
it('should show message that removing topic was unsuccessful', async () => { |
).toBeDisabled(); | ||
}); | ||
|
||
it('should require confirmation text', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
Added actions for: