@linktr.ee/messaging-react 4.5.1 → 4.6.0-rc-1788330362

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linktr.ee/messaging-react",
3
- "version": "4.5.1",
3
+ "version": "4.6.0-rc-1788330362",
4
4
  "description": "React messaging components built on messaging-core for web applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -50,8 +50,8 @@
50
50
  "chromatic:local": "yarn storybook:build && chromatic"
51
51
  },
52
52
  "dependencies": {
53
- "@linktr.ee/messaging-core": "^2.6.0",
54
- "@linktr.ee/messaging-taxonomy": "^0.12.0",
53
+ "@linktr.ee/messaging-core": "2.6.0-rc-1788330362",
54
+ "@linktr.ee/messaging-taxonomy": "0.12.0-rc-1788330362",
55
55
  "@phosphor-icons/react": "^2.1.10"
56
56
  },
57
57
  "devDependencies": {
@@ -85,9 +85,8 @@ const ChannelHeader: React.FC<ChannelHeaderProps> = ({
85
85
  isCustomerPaidTag(channel.data?.customer_tag) &&
86
86
  participant?.is_follower === true
87
87
 
88
- const showStarBadge = showStarButton && isStarred
89
88
  const hasNameAdornment =
90
- isPaidCustomer || showStarBadge || Boolean(onParticipantNameClick)
89
+ isPaidCustomer || isStarred || Boolean(onParticipantNameClick)
91
90
 
92
91
  const handleStarClick = async () => {
93
92
  try {
@@ -134,7 +133,7 @@ const ChannelHeader: React.FC<ChannelHeaderProps> = ({
134
133
  <CurrencyDollarIcon className="size-2.5" weight="bold" />
135
134
  </span>
136
135
  )}
137
- {showStarBadge && (
136
+ {isStarred && (
138
137
  <span className="messaging-header-star-badge flex overflow-hidden">
139
138
  <span
140
139
  aria-label="Starred conversation"
@@ -487,15 +487,14 @@ describe('ChannelView', () => {
487
487
  expect(screen.queryByTestId('conversation-footer')).not.toBeInTheDocument()
488
488
  })
489
489
 
490
- it('does not show a starred badge when showStarButton is false', () => {
490
+ it('shows the starred badge on a starred channel even without the star button', () => {
491
491
  mockIsStarred = true
492
492
 
493
- renderWithProviders(
494
- <ChannelView channel={createChannel()} showStarButton={false} />
495
- )
493
+ renderWithProviders(<ChannelView channel={createChannel()} />)
496
494
 
495
+ expect(screen.getByLabelText('Starred conversation')).toBeInTheDocument()
497
496
  expect(
498
- screen.queryByLabelText('Starred conversation')
497
+ screen.queryByRole('button', { name: 'Unstar conversation' })
499
498
  ).not.toBeInTheDocument()
500
499
  })
501
500
 
@@ -509,10 +508,12 @@ describe('ChannelView', () => {
509
508
  expect(screen.getByLabelText('Starred conversation')).toBeInTheDocument()
510
509
  })
511
510
 
512
- it('does not show a starred badge by default (showStarButton defaults to false)', () => {
513
- mockIsStarred = true
511
+ it('does not show a starred badge when the channel is not starred', () => {
512
+ mockIsStarred = false
514
513
 
515
- renderWithProviders(<ChannelView channel={createChannel()} />)
514
+ renderWithProviders(
515
+ <ChannelView channel={createChannel()} showStarButton={true} />
516
+ )
516
517
 
517
518
  expect(
518
519
  screen.queryByLabelText('Starred conversation')