fmt(desktop): prettier on the channel-display files after main's npm run fix pass
This commit is contained in:
@@ -15,7 +15,13 @@ afterEach((): void => {
|
||||
})
|
||||
|
||||
async function openWith(status: Partial<DesktopUpdateStatus>): Promise<void> {
|
||||
$desktopVersion.set({ appVersion: '0.21.6', electronVersion: '37', hermesRoot: '/h', nodeVersion: '22', platform: 'linux' })
|
||||
$desktopVersion.set({
|
||||
appVersion: '0.21.6',
|
||||
electronVersion: '37',
|
||||
hermesRoot: '/h',
|
||||
nodeVersion: '22',
|
||||
platform: 'linux'
|
||||
})
|
||||
$updateStatus.set({ behind: 0, mechanism: 'posix-handoff', ...status, supported: true })
|
||||
$updateOverlayTarget.set('client')
|
||||
$updateOverlayOpen.set(true)
|
||||
|
||||
@@ -45,8 +45,22 @@ function derive(status: DesktopUpdateStatus | null, apply: UpdateApplyState = ID
|
||||
describe('deriveUpdateStatus', () => {
|
||||
it('names the stable release only when the checkout is on it', () => {
|
||||
const latestRelease = en.settings.about.channel.latestRelease
|
||||
const stable = { supported: true, behind: 0, channel: 'stable', sourceVersion: '0.21.6', targetSha: 'a'.repeat(40), aheadOfRelease: false }
|
||||
const on = deriveUpdateStatus({ apply: IDLE_APPLY, checking: false, latestRelease, status: { ...stable, currentSha: 'a'.repeat(40) }, target: 'client', u: en.updates })
|
||||
const stable = {
|
||||
supported: true,
|
||||
behind: 0,
|
||||
channel: 'stable',
|
||||
sourceVersion: '0.21.6',
|
||||
targetSha: 'a'.repeat(40),
|
||||
aheadOfRelease: false
|
||||
}
|
||||
const on = deriveUpdateStatus({
|
||||
apply: IDLE_APPLY,
|
||||
checking: false,
|
||||
latestRelease,
|
||||
status: { ...stable, currentSha: 'a'.repeat(40) },
|
||||
target: 'client',
|
||||
u: en.updates
|
||||
})
|
||||
expect(on.line).toBe('You’re on the latest stable release (v0.21.6).')
|
||||
|
||||
// Ahead of the release (forward-only): the check pins the target to HEAD, so
|
||||
|
||||
@@ -84,7 +84,14 @@ export function deriveUpdateStatus(input: UpdateStatusInput): UpdateStatusView {
|
||||
return ordinaryUpdateStatus(input)
|
||||
}
|
||||
|
||||
function ordinaryUpdateStatus({ apply, checking, latestRelease, status, target, u }: UpdateStatusInput): UpdateStatusView {
|
||||
function ordinaryUpdateStatus({
|
||||
apply,
|
||||
checking,
|
||||
latestRelease,
|
||||
status,
|
||||
target,
|
||||
u
|
||||
}: UpdateStatusInput): UpdateStatusView {
|
||||
const behind = status?.behind ?? 0
|
||||
// behind is null when the exact count is unknowable (shallow clone): the
|
||||
// backend flags that case via updateAvailable instead of a number.
|
||||
@@ -137,11 +144,7 @@ function ordinaryUpdateStatus({ apply, checking, latestRelease, status, target,
|
||||
return {
|
||||
applying,
|
||||
line:
|
||||
target === 'backend'
|
||||
? u.latestBodyBackend
|
||||
: pinned
|
||||
? latestRelease(`v${status.sourceVersion}`)
|
||||
: u.latestBody,
|
||||
target === 'backend' ? u.latestBodyBackend : pinned ? latestRelease(`v${status.sourceVersion}`) : u.latestBody,
|
||||
supported,
|
||||
tone: 'idle',
|
||||
updateAvailable
|
||||
|
||||
@@ -139,7 +139,10 @@ describe('VersionDetails', () => {
|
||||
const render_ = (action?: boolean) =>
|
||||
render(
|
||||
<I18nProvider>
|
||||
<VersionDetails channelAction={action ? <button type="button">Change</button> : undefined} version={baseVersion} />
|
||||
<VersionDetails
|
||||
channelAction={action ? <button type="button">Change</button> : undefined}
|
||||
version={baseVersion}
|
||||
/>
|
||||
</I18nProvider>
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user