Cover unicode-trimmable baseURL wrappers in acceptance tests
Co-authored-by: Eric Allam <eric@trigger.dev>
This commit is contained in:
@@ -668,6 +668,9 @@ Examples:
|
||||
- ✅ ` https://api.trigger.dev/custom-prefix/// ` (trimmed + normalized)
|
||||
- ✅ `https://api.trigger.dev/custom%20prefix` (percent-encoded whitespace)
|
||||
- ✅ `https://api.trigger.dev/custom%3Fprefix%23segment` (percent-encoded `?` / `#`)
|
||||
- ✅ `\u00A0https://api.trigger.dev/custom-prefix/\u00A0` (non-breaking-space wrapper trimmed)
|
||||
- ✅ `\u1680https://api.trigger.dev/custom-prefix/\u1680` (ogham-space-mark wrapper trimmed)
|
||||
- ✅ `\u3000https://api.trigger.dev/custom-prefix/\u3000` (ideographic-space wrapper trimmed)
|
||||
- ✅ `\uFEFFhttps://api.trigger.dev/custom-prefix/\uFEFF` (BOM wrapper trimmed)
|
||||
- ❌ `\u2060https://api.trigger.dev/custom-prefix/\u2060` (word-joiner wrappers are rejected)
|
||||
- ❌ `\u200Bhttps://api.trigger.dev/custom-prefix/\u200B` (zero-width-space wrappers are rejected)
|
||||
|
||||
@@ -175,6 +175,9 @@ Examples:
|
||||
- ✅ ` https://api.trigger.dev/custom-prefix/// ` (trimmed + normalized)
|
||||
- ✅ `https://api.trigger.dev/custom%20prefix` (percent-encoded whitespace)
|
||||
- ✅ `https://api.trigger.dev/custom%3Fprefix%23segment` (percent-encoded `?` / `#`)
|
||||
- ✅ `\u00A0https://api.trigger.dev/custom-prefix/\u00A0` (non-breaking-space wrapper trimmed)
|
||||
- ✅ `\u1680https://api.trigger.dev/custom-prefix/\u1680` (ogham-space-mark wrapper trimmed)
|
||||
- ✅ `\u3000https://api.trigger.dev/custom-prefix/\u3000` (ideographic-space wrapper trimmed)
|
||||
- ✅ `\uFEFFhttps://api.trigger.dev/custom-prefix/\uFEFF` (BOM wrapper trimmed)
|
||||
- ❌ `\u2060https://api.trigger.dev/custom-prefix/\u2060` (word-joiner wrappers are rejected)
|
||||
- ❌ `\u200Bhttps://api.trigger.dev/custom-prefix/\u200B` (zero-width-space wrappers are rejected)
|
||||
|
||||
@@ -1204,6 +1204,28 @@ describe("TriggerChatTransport", function () {
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
it("accepts ogham-space-mark wrapped baseURL values", function () {
|
||||
expect(function () {
|
||||
new TriggerChatTransport({
|
||||
task: "chat-task",
|
||||
accessToken: "pk_trigger",
|
||||
baseURL: "\u1680https://api.trigger.dev/custom-prefix/\u1680",
|
||||
stream: "chat-stream",
|
||||
});
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
it("accepts ideographic-space wrapped baseURL values", function () {
|
||||
expect(function () {
|
||||
new TriggerChatTransport({
|
||||
task: "chat-task",
|
||||
accessToken: "pk_trigger",
|
||||
baseURL: "\u3000https://api.trigger.dev/custom-prefix/\u3000",
|
||||
stream: "chat-stream",
|
||||
});
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
it("accepts BOM-wrapped baseURL values", function () {
|
||||
expect(function () {
|
||||
new TriggerChatTransport({
|
||||
@@ -4042,6 +4064,28 @@ describe("TriggerChatTransport", function () {
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
it("accepts ogham-space-mark wrapped baseURL values from factory", function () {
|
||||
expect(function () {
|
||||
createTriggerChatTransport({
|
||||
task: "chat-task",
|
||||
accessToken: "pk_trigger",
|
||||
baseURL: "\u1680https://api.trigger.dev/custom-prefix/\u1680",
|
||||
stream: "chat-stream",
|
||||
});
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
it("accepts ideographic-space wrapped baseURL values from factory", function () {
|
||||
expect(function () {
|
||||
createTriggerChatTransport({
|
||||
task: "chat-task",
|
||||
accessToken: "pk_trigger",
|
||||
baseURL: "\u3000https://api.trigger.dev/custom-prefix/\u3000",
|
||||
stream: "chat-stream",
|
||||
});
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
it("accepts BOM-wrapped baseURL values from factory", function () {
|
||||
expect(function () {
|
||||
createTriggerChatTransport({
|
||||
|
||||
Reference in New Issue
Block a user