Implement suggestions of Matt

This commit is contained in:
Wolfgang Huß 2020-01-24 19:33:32 +01:00
parent 1fe9731938
commit 9a8720218f
9 changed files with 16 additions and 15 deletions

View File

@ -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',

View File

@ -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: {

View File

@ -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: {

View File

@ -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: {

View File

@ -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 !!!',
},
},
],

View File

@ -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

View File

@ -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

View File

@ -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')"

View File

@ -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'])
})
})