mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-20 20:01:25 +00:00
Implement suggestions of Matt
This commit is contained in:
parent
1fe9731938
commit
9a8720218f
@ -683,7 +683,7 @@ describe('notifications', () => {
|
||||
|
||||
describe('comment', () => {
|
||||
beforeEach(async () => {
|
||||
commentContent = 'Commenter's comment.'
|
||||
commentContent = "Commenter's comment."
|
||||
commentAuthor = await neode.create('User', {
|
||||
id: 'commentAuthor',
|
||||
name: 'Mrs Comment',
|
||||
|
||||
@ -35,13 +35,13 @@ export default {
|
||||
type: 'string',
|
||||
isoDate: true,
|
||||
required: true,
|
||||
default: () => new Date().toISOString()
|
||||
default: () => new Date().toISOString(),
|
||||
},
|
||||
updatedAt: {
|
||||
type: 'string',
|
||||
isoDate: true,
|
||||
required: true,
|
||||
default: () => new Date().toISOString()
|
||||
default: () => new Date().toISOString(),
|
||||
},
|
||||
read: { type: 'boolean', default: false },
|
||||
reason: {
|
||||
|
||||
@ -27,13 +27,13 @@ export default {
|
||||
type: 'string',
|
||||
isoDate: true,
|
||||
required: true,
|
||||
default: () => new Date().toISOString()
|
||||
default: () => new Date().toISOString(),
|
||||
},
|
||||
updatedAt: {
|
||||
type: 'string',
|
||||
isoDate: true,
|
||||
required: true,
|
||||
default: () => new Date().toISOString()
|
||||
default: () => new Date().toISOString(),
|
||||
},
|
||||
read: { type: 'boolean', default: false },
|
||||
reason: {
|
||||
|
||||
@ -59,13 +59,13 @@ export default {
|
||||
type: 'string',
|
||||
isoDate: true,
|
||||
required: true,
|
||||
default: () => new Date().toISOString()
|
||||
default: () => new Date().toISOString(),
|
||||
},
|
||||
updatedAt: {
|
||||
type: 'string',
|
||||
isoDate: true,
|
||||
required: true,
|
||||
default: () => new Date().toISOString()
|
||||
default: () => new Date().toISOString(),
|
||||
},
|
||||
read: { type: 'boolean', default: false },
|
||||
reason: {
|
||||
|
||||
@ -305,7 +305,8 @@ describe('given some notifications', () => {
|
||||
reportedResource: {
|
||||
__typename: 'Comment',
|
||||
id: 'c4',
|
||||
content: 'I am harassing content in a harassing comment to a bad post !!!',
|
||||
content:
|
||||
'I am harassing content in a harassing comment to a bad post !!!',
|
||||
},
|
||||
},
|
||||
],
|
||||
@ -419,7 +420,8 @@ describe('given some notifications', () => {
|
||||
reportedResource: {
|
||||
__typename: 'Comment',
|
||||
id: 'c4',
|
||||
content: 'I am harassing content in a harassing comment to a bad post !!!',
|
||||
content:
|
||||
'I am harassing content in a harassing comment to a bad post !!!',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@ -185,9 +185,7 @@ export default {
|
||||
},
|
||||
},
|
||||
FILED: {
|
||||
...undefinedToNullResolver([
|
||||
'reasonDescription',
|
||||
]),
|
||||
...undefinedToNullResolver(['reasonDescription']),
|
||||
// Wolle reasonDescription: async (parent, _params, _context, _resolveInfo) => {
|
||||
// if (typeof parent.reasonDescription !== 'undefined') return parent.reasonDescription
|
||||
// return null
|
||||
|
||||
@ -371,7 +371,7 @@ When("I log in with the following credentials:", table => {
|
||||
|
||||
When("open the notification menu and click on the first item", () => {
|
||||
cy.get(".notifications-menu").invoke('show').click(); // "invoke('show')" because of the delay for show the menu
|
||||
cy.get('[data-test-id="notification-link"]')
|
||||
cy.get('[data-testid="notification-link"]')
|
||||
.first()
|
||||
.click({
|
||||
force: true
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
</client-only>
|
||||
<ds-space margin-bottom="x-small" />
|
||||
<nuxt-link
|
||||
data-test-id="notification-link"
|
||||
data-testid="notification-link"
|
||||
class="notification-link-for-test"
|
||||
:to="notificationData.linkTo"
|
||||
@click.native="$emit('read')"
|
||||
|
||||
@ -75,9 +75,10 @@ describe('NotificationList.vue', () => {
|
||||
beforeEach(() => {
|
||||
// Wolle wrapper.find('.notification-link-for-test').trigger('click')
|
||||
wrapper.getByTestId('notification-link').trigger('click')
|
||||
expect(wrapper.attributes('id')).toBe('foo')
|
||||
})
|
||||
|
||||
it("emits 'markAsRead' with the id of the notification source", () => {
|
||||
it.only("emits 'markAsRead' with the id of the notification source", () => {
|
||||
expect(wrapper.emitted('markAsRead')[0]).toEqual(['post-1'])
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user