Skip to content

Commit

Permalink
fix(core): rename below-than-or-equal-version to less-than-or-equal-v…
Browse files Browse the repository at this point in the history
…ersion
  • Loading branch information
pedrobonamin committed Sep 23, 2024
1 parent c85bd1b commit b3c9a12
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -480,11 +480,11 @@ describe('StudioAnnouncementsProvider', () => {
expect(result.current.unseenAnnouncements).toEqual([])
expect(result.current.studioAnnouncements).toEqual([])
})
test('if the audience is below-than-or-equal-version and studio is above', () => {
test('if the audience is less-than-or-equal-version and studio is above', () => {
const announcements: StudioAnnouncementDocument[] = [
{
...mockAnnouncements[1],
audience: 'below-than-or-equal-version',
audience: 'less-than-or-equal-version',
studioVersion: '3.56.0',
},
]
Expand All @@ -497,11 +497,11 @@ describe('StudioAnnouncementsProvider', () => {
expect(result.current.unseenAnnouncements).toEqual([])
expect(result.current.studioAnnouncements).toEqual([])
})
test('if the audience is below-than-or-equal-version and studio is below', () => {
test('if the audience is less-than-or-equal-version and studio is below', () => {
const announcements: StudioAnnouncementDocument[] = [
{
...mockAnnouncements[1],
audience: 'below-than-or-equal-version',
audience: 'less-than-or-equal-version',
studioVersion: '3.58.0',
},
]
Expand All @@ -514,11 +514,11 @@ describe('StudioAnnouncementsProvider', () => {
expect(result.current.unseenAnnouncements).toEqual(announcements)
expect(result.current.studioAnnouncements).toEqual(announcements)
})
test('if the audience is below-than-or-equal-version and studio is equal', () => {
test('if the audience is less-than-or-equal-version and studio is equal', () => {
const announcements: StudioAnnouncementDocument[] = [
{
...mockAnnouncements[1],
audience: 'below-than-or-equal-version',
audience: 'less-than-or-equal-version',
studioVersion: '3.57.0',
},
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('isValidAnnouncementAudience', () => {
})
})
describe('when audience is "below-version"', () => {
const document = {audience: 'below-than-or-equal-version', studioVersion: '3.55.0'} as const
const document = {audience: 'less-than-or-equal-version', studioVersion: '3.55.0'} as const
test('should return false when sanityVersion is above document.studioVersion', () => {
const sanityVersion = '3.56.0'
expect(isValidAnnouncementAudience(document, sanityVersion)).toBe(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface StudioAnnouncementDocument {
| 'everyone'
| 'specific-version'
| 'greater-than-or-equal-version'
| 'below-than-or-equal-version'
| 'less-than-or-equal-version'
audienceRole?: AudienceRole[] | undefined
studioVersion?: string
preHeader: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function isValidAnnouncementAudience(
return satisfies(sanityVersion, `>= ${document.studioVersion}`, {
includePrerelease: true,
})
case 'below-than-or-equal-version':
case 'less-than-or-equal-version':
return satisfies(sanityVersion, `<= ${document.studioVersion}`, {
includePrerelease: true,
})
Expand Down

0 comments on commit b3c9a12

Please sign in to comment.