Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aeolianeth committed Jan 7, 2025
1 parent d49546c commit 950d3d1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,27 +135,6 @@ exports[`CurrentUpcomingSubPanel renders "upcoming" 1`] = `
<div
class="flex flex-col gap-4"
>
<div
class="flex items-center gap-2 rounded-lg py-2 px-3.5 text-sm font-medium shadow-sm border-bluebs-100 bg-bluebs-25 text-bluebs-700 dark:border-bluebs-800 dark:bg-bluebs-950 dark:text-bluebs-400"
>
<svg
aria-hidden="true"
class="h-5 w-5"
data-slot="icon"
fill="none"
stroke="currentColor"
stroke-width="1.5"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
Starts in
</div>
<div
class="grid grid-cols-2 gap-4 md:flex"
>
Expand Down Expand Up @@ -396,27 +375,6 @@ exports[`CurrentUpcomingSubPanel renders a skeleton when loading "upcoming" 1`]
<div
class="flex flex-col gap-4"
>
<div
class="flex items-center gap-2 rounded-lg py-2 px-3.5 text-sm font-medium shadow-sm border-bluebs-100 bg-bluebs-25 text-bluebs-700 dark:border-bluebs-800 dark:bg-bluebs-950 dark:text-bluebs-400"
>
<svg
aria-hidden="true"
class="h-5 w-5"
data-slot="icon"
fill="none"
stroke="currentColor"
stroke-width="1.5"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
Starts in
</div>
<div
class="grid grid-cols-2 gap-4 md:flex"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe('useFormatConfigurationCyclesSection', () => {

const mockUpcomingFundingCycle = {
duration: BigNumber.from(20000),
start: BigNumber.from(1),
ballot: '0x0000000000000000000000000000000000000001',
}

Expand Down Expand Up @@ -57,7 +58,7 @@ describe('useFormatConfigurationCyclesSection', () => {
}
const expectedStartTime = {
name: 'Start time',
new: '1970-01-01, Thursday, 02:46:40 AM UTC',
new: '1970-01-01, Thursday, 12:00:01 AM UTC', // BigNumber.from(1)
// new: '1970-01-01, Wednesday, 09:46:40 PM EST',
easyCopy: true,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ export const useFormatConfigurationCyclesSection = ({
const startTimeDatum: ConfigurationPanelDatum = useMemo(() => {
const formattedTime =
upcomingFundingCycle === null
? formatTime(fundingCycle?.start.toNumber())
? formatTime(fundingCycle?.start?.toNumber())
: fundingCycle?.duration.isZero() &&
getBallotStrategyByAddress(fundingCycle?.ballot)?.durationSeconds ===
0
? t`Any time`
: formatTime(upcomingFundingCycle?.start.toNumber())
: formatTime(upcomingFundingCycle?.start?.toNumber())

const formatTimeDatum: ConfigurationPanelDatum = {
name: t`Start time`,
Expand Down

0 comments on commit 950d3d1

Please sign in to comment.