internal/testkit/htmltest parses rendered HTML and selects from it with CSS selectors (Parse and ParseIn, One, All, Count, None, Text, Texts, Attr, HasClass, HTML, Before, InOrder), on golang.org/x/net/html and github.com/andybalholm/cascadia, which joins go.mod as a direct requirement (BSD-2-Clause, pure Go, depending only on x/net). A page, which opens with a doctype or an html element, parses as a whole document, so the attributes of its html and body elements are kept; any other body parses as a fragment, a table row under a tbody, an option under a select and anything else under a body. Both parse with scripting off, so what a noscript holds is elements that selectors reach, as a browser without JavaScript renders it. Its own tests: the fragment context for tr and option, the attributes of html and body, the content of noscript, One's failure message naming the selector, None, Text, selection by attribute and role, Before, and InOrder. The import guard gets a row for it, and scripts/deadcode-testonly.txt an entry. harness_test.go gains the shell assertions both surfaces share, exported for server_test: the top bar, the account menu, the Identity and Access handoff, the drawer and the rail's account block. member_nav_test.go and operator_sidebar_render_test.go select regions by landmark and ARIA (nav.navbar[aria-label=Account], aside#app-rail, the account group's aria-labelledby list) and controls by attribute ([data-form="shell.confirm"], the button posting to /logout) instead of regionBetween, topBarRegion, railRegion and sidebarRegion, read aria-current on each member rail entry and on both surface switches, check order through InOrder, and keep a class assertion only where the class is the fact. sidebarSections selects the entry list instead of slicing the rail string, and sidebarLinkActive reads the link node instead of matching a regular expression. The page subtests of TestShellAccountMenu and TestShellMemberRail call named functions (checkAccountMenuPage, checkMemberRail); every test and subtest name is unchanged. Each ban and each count keeps the region the old one covered, or a wider one; a check that an element is present looks where the element belongs, such as the trigger and the Get help order in the bar and the entries in the rail, which is narrower than the body the old strings searched and stricter. A bar, a rail or a page the old tests searched as a string is searched as markup (Node.HTML) where the old string covered the element's own tag, the html and body start tags, or an attribute: the rail's d-lg-none count, app-rail-signout, d-none d-lg-flex, the identity tooltip, the operator rail's nav-link count and its ps-4, group and /logout bans, text-danger, navbar-collapse, the handoff explanation, mt-2 pt-2 border-top, and the bar's bans over everything before the rail. Counts that were page-wide stay page-wide: the account menu (any tag), the Get help item, the Operator panel switch, the dismiss control, the hx-post="/logout" controls (counted as markup, so data-hx-post counts), the bans on href="/logout" (markup, so any attribute ending in href counts) and the account-console links; those inside the rail are counted over the whole rail before they are placed in the account group: the group's name and email spans, its list, the Identity and Access, Sign out and Get help entries. The Dashboard link count and the Operator link ban also run over the page's markup, the drawer's two lists are counted by class prefix as well, and nothing before the account group reads Sign out. Where the old tests pinned an element's class as an exact string, the new ones compare its class token set exactly (AssertClassSet), which ignores token order only; the checks that were prefixes or regular expressions stay HasClass or class selectors, and an active operator entry must still carry nav-link. aria-current appears on the active rail entry and nowhere else in the member rail, and on neither surface switch nor the account group's entries. Sign out, Get help and the account group's name and email stay plain text, the trigger's one child is its label span, the menu header's children are the line break and the email span, and the line break follows the name. The closing </main> check stays a text check, since a parser closes the element anyway. One weakening is general: a markup change that alters no asserted fact no longer fails, such as an attribute added to an element the old tests matched as a whole markup string (a data attribute on Sign out, say), a wrapper, or a decorative child the comments do not exclude. No specific fact is kept weaker. The four gocognit exclusions of TestShellAccountMenu, TestShellMemberRail, TestShellRailAccountBlock and TestOperatorShellTopBarAndDrawer are gone; the lint reports nothing in their place. 124 breaks: 118 failed the old and the new shell tests (the template and code changes that move, drop or mislabel each asserted element; an untitled Get help item in the bar, the drawer's header and the rail; a Log out title on the brand link; an extra class on Sign out, on the email span, on the switch's li and on the page title; a missing class on the rail or on an account entry's li; a button among the rail's entries; a surface label, a Get help link or a danger Dashboard link between the bar and the rail; a logout button in the drawer's header or a logout form among its entries; the tooltip on the li or on the account trigger; an Operator panel label for a member without the role; a noscript holding a second main, a Dashboard link or a Sign out link to /logout; a data-hx-post Sign out in the content or the menu, and a data-href to /logout; aria-current on a surface switch or on Identity and Access; an active Billing entry without nav-link; a second account-console link or Identity and Access item; an element inside Sign out, the trigger, the menu header or the group's name; a class on the rail's own tag, on the html or body tag, or a second element where the old string counted one: the account menu, Get help, the Operator panel switch, a plain Sign out, the group's name and email, its list; a Sign out button before the account group on either surface; a Dashboard or an Operator link with a decorative child in the content; a third nav list; a bar without its navbar class), and 6 on the helper's own tests have no old side. The names and results of internal/server equal the parent's; new tests: TestParseKeepsRowsAndOptionsThatABodyContextDrops, TestParseKeepsTheAttributesOfHtmlAndBody, TestParseSelectsInsideNoscript, TestOneFailureNamesTheSelector, TestNoneFailureNamesTheSelectorAndQuotesTheMatch, TestTextCollapsesWhitespaceAndSelectsInDocumentOrder, TestSelectionByAttributeAndRole, TestBeforeHoldsWhatPrecedesTheMatch and TestInOrder in htmltest, and the guard's htmltest subtest.
84 lines
3.4 KiB
AMPL
84 lines
3.4 KiB
AMPL
module git.coopcloud.tech/wiki-cafe/member-console
|
|
|
|
go 1.27.1
|
|
|
|
require (
|
|
github.com/CAFxX/httpcompression v0.0.9
|
|
github.com/alexedwards/scs/redisstore v0.0.0-20251002162104-209de6e426de
|
|
github.com/alexedwards/scs/v2 v2.9.0
|
|
github.com/andybalholm/cascadia v1.3.3
|
|
github.com/coreos/go-oidc/v3 v3.12.0
|
|
github.com/go-jose/go-jose/v4 v4.1.5
|
|
github.com/go-rod/rod v0.116.2
|
|
github.com/gomodule/redigo v1.9.3
|
|
github.com/google/uuid v1.6.0
|
|
github.com/jackc/pgx/v5 v5.11.0
|
|
github.com/lib/pq v1.12.0
|
|
github.com/pressly/goose/v3 v3.24.3
|
|
github.com/rs/cors v1.11.1
|
|
github.com/spf13/cobra v1.8.1
|
|
github.com/spf13/viper v1.19.0
|
|
github.com/sqlc-dev/pqtype v0.3.0
|
|
github.com/stretchr/testify v1.11.1
|
|
github.com/stripe/stripe-go/v81 v81.4.0
|
|
go.temporal.io/api v1.54.0
|
|
go.temporal.io/sdk v1.38.0
|
|
golang.org/x/net v0.59.0
|
|
golang.org/x/oauth2 v0.36.0
|
|
golang.org/x/sync v0.23.0
|
|
golang.org/x/text v0.42.0
|
|
golang.org/x/time v0.5.0
|
|
golang.org/x/tools v0.51.0
|
|
gopkg.in/yaml.v3 v3.0.1
|
|
)
|
|
|
|
require (
|
|
github.com/andybalholm/brotli v1.1.1 // indirect
|
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
|
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
|
|
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
|
github.com/gogo/protobuf v1.3.2 // indirect
|
|
github.com/golang/mock v1.6.0 // indirect
|
|
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 // indirect
|
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
|
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
|
github.com/jackc/pgpassfile v1.0.0 // indirect
|
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
|
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
|
github.com/klauspost/compress v1.18.0 // indirect
|
|
github.com/magiconair/properties v1.8.7 // indirect
|
|
github.com/mfridman/interpolate v0.0.2 // indirect
|
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
|
github.com/nexus-rpc/sdk-go v0.5.1 // indirect
|
|
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
|
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
|
github.com/robfig/cron v1.2.0 // indirect
|
|
github.com/sagikazarmark/locafero v0.4.0 // indirect
|
|
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
|
github.com/sethvargo/go-retry v0.3.0 // indirect
|
|
github.com/sourcegraph/conc v0.3.0 // indirect
|
|
github.com/spf13/afero v1.11.0 // indirect
|
|
github.com/spf13/cast v1.6.0 // indirect
|
|
github.com/spf13/pflag v1.0.5 // indirect
|
|
github.com/stretchr/objx v0.5.2 // indirect
|
|
github.com/subosito/gotenv v1.6.0 // indirect
|
|
github.com/ysmood/fetchup v0.2.3 // indirect
|
|
github.com/ysmood/goob v0.4.0 // indirect
|
|
github.com/ysmood/got v0.40.0 // indirect
|
|
github.com/ysmood/gson v0.7.3 // indirect
|
|
github.com/ysmood/leakless v0.9.0 // indirect
|
|
go.uber.org/multierr v1.11.0 // indirect
|
|
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 // indirect
|
|
golang.org/x/mod v0.41.0 // indirect
|
|
golang.org/x/sys v0.48.0 // indirect
|
|
golang.org/x/telemetry v0.0.0-20260924152758-ed294f943157 // indirect
|
|
google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa // indirect
|
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect
|
|
google.golang.org/grpc v1.83.2 // indirect
|
|
google.golang.org/protobuf v1.36.11 // indirect
|
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
|
)
|
|
|
|
tool golang.org/x/tools/cmd/deadcode
|