Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions uts/docs/completion-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ This matrix lists all spec items from the [Ably features spec](../../specificati
| TN1–TN3 | Token string | |
| AD1–AD2 | AuthDetails | |
| TS1–TS14 | Stats | |
| TI1–TI5 | ErrorInfo | Yes — `rest/unit/types/error_types.md` |
| TI1, TI2, TI4 | ErrorInfo | Yes — `rest/unit/types/error_types.md` |
| TA1–TA5 | ConnectionStateChange | |
| TH1–TH6 | ChannelStateChange | Yes — `realtime/unit/channels/channel_state_events.md` |
| TC1–TC2 | Capability | |
Expand All @@ -356,7 +356,7 @@ This matrix lists all spec items from the [Ably features spec](../../specificati
| Spec item | Description | UTS test spec |
|-----------|-------------|---------------|
| TO1–TO3 | ClientOptions | Yes — `rest/unit/types/options_types.md` |
| TK1–TK6 | TokenParams | Yes — `rest/unit/types/token_types.md` |
| TK1, TK2, TK2a–TK2e | TokenParams | Yes — `rest/unit/types/token_types.md` |
| AO1–AO2 | AuthOptions | Yes — `rest/unit/types/options_types.md` |
| TB1–TB4 | ChannelOptions | Yes — `realtime/unit/channels/channel_options.md` |
| DO1–DO2 | DeriveOptions | Yes — `realtime/unit/channels/channel_options.md` |
Expand Down
18 changes: 9 additions & 9 deletions uts/rest/unit/auth/authorize.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Auth.authorize() Tests

Spec points: `RSA10`, `RSA10a`, `RSA10b`, `RSA10e`, `RSA10g`, `RSA10h`, `RSA10i`, `RSA10j`, `RSA10k`, `RSA10l`
Spec points: `RSA10`, `RSA10a`, `RSA10b`, `RSA10e`, `RSA10g`, `RSA10i`, `RSA10j`, `RSA10k`, `RSA10l`, `RSA16c`

## Test Type
Unit test with mocked HTTP client and/or mocked authCallback
Expand Down Expand Up @@ -111,9 +111,9 @@ ASSERT params.ttl == 7200000

---

## RSA10e - authorize() saves tokenParams for reuse
## RSA10g - authorize() saves tokenParams for reuse

**Test ID**: `rest/unit/RSA10e/authorize-saves-params-0`
**Test ID**: `rest/unit/RSA10g/authorize-saves-params-0`

**Spec requirement:** `tokenParams` provided to `authorize()` are saved and reused on subsequent token requests.

Expand Down Expand Up @@ -166,9 +166,9 @@ ASSERT callback_invocations[1].ttl == 3600000

---

## RSA10g - authorize() updates Auth.tokenDetails
## RSA16c - authorize() updates Auth.tokenDetails

**Test ID**: `rest/unit/RSA10g/authorize-updates-token-details-0`
**Test ID**: `rest/unit/RSA16c/authorize-updates-token-details-0`

**Spec requirement:** After `authorize()`, `auth.tokenDetails` reflects the new token.

Expand Down Expand Up @@ -209,9 +209,9 @@ ASSERT client.auth.tokenDetails == result # Same object

---

## RSA10h - authorize() with authOptions replaces defaults
## RSA10j - authorize() with authOptions replaces defaults

**Test ID**: `rest/unit/RSA10h/authorize-replaces-auth-options-0`
**Test ID**: `rest/unit/RSA10j/authorize-replaces-auth-options-0`

**Spec requirement:** `authOptions` in `authorize()` replaces stored auth options.

Expand Down Expand Up @@ -312,9 +312,9 @@ AWAIT client.auth.authorize(

---

## RSA10j - authorize() when already authorized
## RSA10a - authorize() when already authorized

**Test ID**: `rest/unit/RSA10j/authorize-replaces-existing-token-0`
**Test ID**: `rest/unit/RSA10a/authorize-replaces-existing-token-1`

**Spec requirement:** Calling `authorize()` when a valid token exists obtains a new token.

Expand Down
28 changes: 14 additions & 14 deletions uts/rest/unit/channel/idempotency.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ ASSERT client.options.idempotentRestPublishing == true

---

## RSL1k2 - Message ID format when idempotent publishing enabled
## RSL1k1 - Message ID format when idempotent publishing enabled

**Test ID**: `rest/unit/RSL1k2/message-id-format-0`
**Test ID**: `rest/unit/RSL1k1/message-id-format-1`

**Spec requirement:** When `idempotentRestPublishing` is enabled, library-generated message IDs must follow the format `<base64>:<serial>` where base64 is a URL-safe base64-encoded random value and serial is a zero-based sequential integer.

Expand Down Expand Up @@ -99,9 +99,9 @@ ASSERT parts[1] == "0"

---

## RSL1k2 - Serial increments for batch publish
## RSL1k1 - Serial increments for batch publish

**Test ID**: `rest/unit/RSL1k2/serial-increments-batch-1`
**Test ID**: `rest/unit/RSL1k1/serial-increments-batch-2`

**Spec requirement:** When publishing multiple messages in a batch, all messages must share the same base ID with incrementing serial numbers starting from 0.

Expand Down Expand Up @@ -161,9 +161,9 @@ ASSERT serials == [0, 1, 2]

---

## RSL1k3 - Separate publishes get unique base IDs
## RSL1k1 - Separate publishes get unique base IDs

**Test ID**: `rest/unit/RSL1k3/unique-base-ids-0`
**Test ID**: `rest/unit/RSL1k1/unique-base-ids-3`

**Spec requirement:** Each separate publish call must generate a new unique base ID, even for messages published to the same channel.

Expand Down Expand Up @@ -210,9 +210,9 @@ ASSERT base1 != base2

---

## RSL1k3 - No ID generated when idempotent publishing disabled
## RSL1k1 - No ID generated when idempotent publishing disabled

**Test ID**: `rest/unit/RSL1k3/no-id-when-disabled-1`
**Test ID**: `rest/unit/RSL1k1/no-id-when-disabled-4`

**Spec requirement:** When `idempotentRestPublishing` is false, the library must not automatically generate message IDs.

Expand Down Expand Up @@ -255,9 +255,9 @@ ASSERT "id" NOT IN body

---

## RSL1k - Client-supplied ID preserved
## RSL1k2 - Client-supplied ID preserved

**Test ID**: `rest/unit/RSL1k/client-id-preserved-0`
**Test ID**: `rest/unit/RSL1k2/client-id-preserved-0`

**Spec requirement:** Client-supplied message IDs must be preserved and transmitted exactly as provided, even when `idempotentRestPublishing` is enabled.

Expand Down Expand Up @@ -302,9 +302,9 @@ ASSERT body["id"] == "my-custom-id"

---

## RSL1k2 - Same ID used on retry
## RSL1k1 - Same ID used on retry

**Test ID**: `rest/unit/RSL1k2/same-id-on-retry-2`
**Test ID**: `rest/unit/RSL1k1/same-id-on-retry-5`

**Spec requirement:** When a publish request is retried after a failure, the same message ID(s) must be used to ensure idempotent behavior.

Expand Down Expand Up @@ -357,9 +357,9 @@ ASSERT body1["id"] == body2["id"]

---

## RSL1k - Mixed client and library IDs in batch
## RSL1k3 - Mixed client and library IDs in batch

**Test ID**: `rest/unit/RSL1k/mixed-ids-in-batch-1`
**Test ID**: `rest/unit/RSL1k3/mixed-ids-in-batch-0`

**Spec requirement:** In a batch publish, messages with client-supplied IDs must be preserved, while messages without IDs receive library-generated IDs using the standard format.

Expand Down
38 changes: 19 additions & 19 deletions uts/rest/unit/types/error_types.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Error Types Tests

Spec points: `TI1`, `TI2`, `TI3`, `TI4`, `TI5`
Spec points: `TI1`, `TI2`, `TI4`

## Test Type
Unit test - pure type/model validation
Expand All @@ -10,19 +10,19 @@ No mocks required - these verify type structure.

---

## TI1-TI5 - ErrorInfo attributes
## TI1, TI4 - ErrorInfo attributes

**Test ID**: `rest/unit/TI1/errorinfo-attributes-0`

**Spec requirement:** ErrorInfo type must provide all required attributes according to TI1-TI5 specifications.
**Spec requirement:** ErrorInfo type must provide all required attributes according to TI1 (and TI4 for `href`).

| Spec | Attribute | Description |
|------|-----------|-------------|
| TI1 | code | Ably-specific error code |
| TI2 | statusCode | HTTP status code |
| TI3 | message | Human-readable error message |
| TI4 | href | URL for more information |
| TI5 | cause | Underlying cause error/exception |
| TI1 | statusCode | HTTP status code |
| TI1 | message | Human-readable error message |
| TI1, TI4 | href | URL for more information |
| TI1 | cause | Underlying cause error/exception |

Tests that `ErrorInfo` (or `AblyException`) has all required attributes.

Expand All @@ -31,37 +31,37 @@ Tests that `ErrorInfo` (or `AblyException`) has all required attributes.
| ID | Spec | Attribute | Type | Description |
|----|------|-----------|------|-------------|
| 1 | TI1 | `code` | Integer | Ably-specific error code |
| 2 | TI2 | `statusCode` | Integer | HTTP status code |
| 3 | TI3 | `message` | String | Human-readable error message |
| 4 | TI4 | `href` | String | URL for more information |
| 5 | TI5 | `cause` | Error/Exception | Underlying cause |
| 2 | TI1 | `statusCode` | Integer | HTTP status code |
| 3 | TI1 | `message` | String | Human-readable error message |
| 4 | TI1, TI4 | `href` | String | URL for more information |
| 5 | TI1 | `cause` | Error/Exception | Underlying cause |

### Test Steps
```pseudo
# TI1 - code attribute
error = ErrorInfo(code: 40000)
ASSERT error.code == 40000

# TI2 - statusCode attribute
# TI1 - statusCode attribute
error = ErrorInfo(code: 40100, statusCode: 401)
ASSERT error.statusCode == 401

# TI3 - message attribute
# TI1 - message attribute
error = ErrorInfo(
code: 40000,
statusCode: 400,
message: "Bad request: invalid parameter"
)
ASSERT error.message == "Bad request: invalid parameter"

# TI4 - href attribute (optional)
# TI1, TI4 - href attribute (optional)
error = ErrorInfo(
code: 40000,
href: "https://help.ably.io/error/40000"
)
ASSERT error.href == "https://help.ably.io/error/40000"

# TI5 - cause attribute (optional)
# TI1 - cause attribute (optional)
original_error = Exception("Network failure")
error = ErrorInfo(
code: 50003,
Expand All @@ -74,9 +74,9 @@ ASSERT error.cause == original_error

---

## TI - ErrorInfo from JSON response
## TI2 - ErrorInfo from JSON response

**Test ID**: `rest/unit/TI/errorinfo-from-json-0`
**Test ID**: `rest/unit/TI2/errorinfo-from-json-0`

**Spec requirement:** ErrorInfo type must support deserialization from Ably JSON error responses.

Expand Down Expand Up @@ -136,9 +136,9 @@ IF error.cause IS ErrorInfo:

---

## TI - AblyException wraps ErrorInfo
## TI2 - AblyException wraps ErrorInfo

**Test ID**: `rest/unit/TI/ably-exception-wraps-errorinfo-2`
**Test ID**: `rest/unit/TI2/ably-exception-wraps-errorinfo-2`

**Spec requirement:** AblyException (throwable) must wrap ErrorInfo and expose its attributes.

Expand Down
Loading
Loading