Fix tests
This commit is contained in:
parent
3b8c217a25
commit
589af8060e
4 changed files with 27 additions and 6 deletions
|
|
@ -687,6 +687,10 @@ test("US-053 browse and search the library", async ({seed, as}) => {
|
|||
|
||||
await expect(alice.getByText("The Handbook")).toBeVisible()
|
||||
|
||||
await alice.getByRole("button", {name: /Recipes/}).click()
|
||||
|
||||
await expect(alice.getByText("This shelf doesn't have any links yet.")).toBeVisible()
|
||||
|
||||
// The library is the whole space's, so an ordinary member is offered the same controls.
|
||||
await expect(alice.getByRole("button", {name: "Create Shelf"})).toBeVisible()
|
||||
await expect(alice.getByRole("button", {name: "Add a link"})).toBeVisible()
|
||||
|
|
|
|||
|
|
@ -24,8 +24,9 @@ import {
|
|||
} from "../harness"
|
||||
import type {SeededEvent, SeededSpace, TestUser} from "../harness"
|
||||
|
||||
// A small primary-colored dot in the corner. RelaySummary's member check is the same shape at h-5 w-5.
|
||||
const unreadDot = (scope: Locator) => scope.locator("div.h-2.w-2.rounded-full.bg-primary")
|
||||
// The primary nav draws its dot in utilities and the space menu's rooms carry secondary-nav__dot.
|
||||
const unreadDot = (scope: Locator) =>
|
||||
scope.locator("div.h-2.w-2.rounded-full.bg-primary, div.secondary-nav__dot")
|
||||
|
||||
// An icon is a css mask built from a data url, so a room only renders this one when it is muted.
|
||||
const mutedRoomBell = (room: Locator) => room.locator("div.ml-auto.opacity-50")
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import {
|
|||
range,
|
||||
removeUndefined,
|
||||
sleep,
|
||||
spec,
|
||||
uniqBy,
|
||||
DAY,
|
||||
MONTH,
|
||||
|
|
@ -704,17 +705,24 @@ export const makeCalendarFeed = ({
|
|||
const compareByStart = (a: TrustedEvent, b: TrustedEvent) =>
|
||||
getStart(a) - getStart(b) || compareEventsAsc(a, b)
|
||||
|
||||
// The filters take in comments too, for the feed context, and a TimeEvent reader throws on them.
|
||||
const isValid = (event: TrustedEvent) => {
|
||||
const timeEvent = reader(TimeEvent)(event)
|
||||
if (event.kind === EVENT_TIME) {
|
||||
const timeEvent = reader(TimeEvent)(event)
|
||||
|
||||
return timeEvent.start() && timeEvent.end() && !seen.has(event.id)
|
||||
return timeEvent.start() && timeEvent.end() && !seen.has(event.id)
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
const events = writable(
|
||||
uniqBy(
|
||||
e => e.id,
|
||||
relays.flatMap(url => app.get().use(Events).forUrl(url, filters).get()),
|
||||
).sort(compareByStart),
|
||||
)
|
||||
.filter(spec({kind: EVENT_TIME}))
|
||||
.sort(compareByStart),
|
||||
)
|
||||
|
||||
const insertEvents = (newEvents: TrustedEvent[]) => {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,15 @@
|
|||
component={EmojiPicker}
|
||||
strayMargin={allowKaomoji ? undefined : 100}
|
||||
props={{onClick, allowKaomoji}}
|
||||
params={{trigger: "manual", interactive: true, ...tippyParams}}>
|
||||
params={{
|
||||
trigger: "manual",
|
||||
interactive: true,
|
||||
// Popper only flips to a side the picker fits on whole, and it's taller than half a laptop screen.
|
||||
popperOptions: {
|
||||
modifiers: [{name: "flip", options: {fallbackPlacements: ["bottom", "left", "right"]}}],
|
||||
},
|
||||
...tippyParams,
|
||||
}}>
|
||||
{@render children?.()}
|
||||
</Tippy>
|
||||
</Button>
|
||||
|
|
|
|||
Loading…
Reference in a new issue