mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
feat(replay-ui): render idPrefix targets as a prefix tag
This commit is contained in:
1 parent
0122f241dc
commit
a5d358e24e
2 files changed
+6
No files matched your search
@@ -15,6 +15,10 @@ describe("parseSelector", () => {
|
||||
{ input: "id:login", out: { kind: "id", value: "login" } },
|
||||
{ input: "text:Sign In", out: { kind: "text", value: "Sign In" } },
|
||||
{ input: "textPrefix:Hello", out: { kind: "textPrefix", value: "Hello" } },
|
||||
{
|
||||
input: "idPrefix:customer_row_",
|
||||
out: { kind: "idPrefix", value: "customer_row_" },
|
||||
},
|
||||
{ input: "id:com.app:id/btn", out: { kind: "id", value: "com.app:id/btn" } },
|
||||
{ input: "bogus:x", out: null },
|
||||
{ input: ":leading", out: null },
|
||||
@@ -30,6 +34,7 @@ describe("parseSelector", () => {
|
||||
describe("tagFromSelector", () => {
|
||||
it("appends ellipsis only for prefix selectors", () => {
|
||||
expect(tagFromSelector("textPrefix:Hel")).toBe("Hel...");
|
||||
expect(tagFromSelector("idPrefix:customer_row_")).toBe("customer_row_...");
|
||||
expect(tagFromSelector("text:Hello")).toBe("Hello");
|
||||
expect(tagFromSelector("plain")).toBe("plain");
|
||||
});
|
||||
|
||||
@@ -8,6 +8,7 @@ export interface FormattedRow {
|
||||
|
||||
const SELECTOR_PREFIXES = [
|
||||
"id",
|
||||
"idPrefix",
|
||||
"text",
|
||||
"textPrefix",
|
||||
"desc",
|
||||
|
||||
Reference in new issue
Block a user