community-platform icon indicating copy to clipboard operation
community-platform copied to clipboard

fix: Add spaces to notifications with urls

Open exabyssus opened this issue 11 months ago • 2 comments

Description

Adds spaces between words in notifications

Git Issues

Closes #3330

Screenshots/Videos

Screenshot 2024-03-07 at 01 02 31

exabyssus avatar Mar 06 '24 23:03 exabyssus

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 66.10%. Comparing base (38d5be0) to head (86f06cb).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3331      +/-   ##
==========================================
+ Coverage   66.00%   66.10%   +0.09%     
==========================================
  Files         418      418              
  Lines       13543    13543              
  Branches     2493     2493              
==========================================
+ Hits         8939     8952      +13     
+ Misses       4552     4539      -13     
  Partials       52       52              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 07 '24 10:03 codecov[bot]

maybe a test update would be good, something like

import { MemoryRouter } from 'react-router-dom'
import { render } from '@testing-library/react'
import { NotificationTypes } from 'oa-shared'
import { FactoryNotification } from 'src/test/factories/Notification'

import { getFormattedNotifications } from './getFormattedNotifications'

describe('getFormattedNotifications', () => {
  NotificationTypes.forEach((type) => {
    it(`returns a well formatted ${type} message with spaces between words and values`, () => {
      const [notification] = getFormattedNotifications([
        FactoryNotification({ type }),
      ])
      const { container } = render(
        <MemoryRouter>{notification.children}</MemoryRouter>,
      )
      expect(container).not.toBeEmptyDOMElement()

      // Assert that there are spaces between words and values in the formatted notification message
      const formattedMessage = container.textContent
      const words = formattedMessage.split(' ')
      expect(words.length).toBeGreaterThan(0)
    })
  })
})

rchick avatar Mar 10 '24 11:03 rchick

Hey @exabyssus. Are you still able to work on this?

benfurber avatar Mar 28 '24 13:03 benfurber

Passing run #5404 ↗︎

0 98 0 0 Flakiness 0

Details:

Merge branch 'master' into 3330-notification-spaces
Project: onearmy-community-platform Commit: 86f06cb7c9
Status: Passed Duration: 04:53 💡
Started: Apr 12, 2024 1:49 PM Ended: Apr 12, 2024 1:54 PM

Review all test suite changes for PR #3331 ↗︎

cypress[bot] avatar Apr 12 '24 13:04 cypress[bot]

Shame not to have the test for this but still want to merge it in. Thanks for your work @exabyssus.

benfurber avatar Apr 12 '24 14:04 benfurber

@all-contributors please add @exabyssus for code

benfurber avatar Apr 12 '24 14:04 benfurber

@benfurber

I've put up a pull request to add @exabyssus! :tada:

allcontributors[bot] avatar Apr 12 '24 14:04 allcontributors[bot]

:tada: This PR is included in version 1.172.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

onearmy-bot avatar Apr 15 '24 15:04 onearmy-bot