Skip to content
Open
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
31 changes: 17 additions & 14 deletions Firestore/Swift/Tests/Integration/PipelineTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1616,17 +1616,17 @@ class PipelineIntegrationTests: FSTIntegrationTestCase {
.collection(collRef.path)
.select([
Field("title"),
Field("published").logicalMaximum([Constant(1960), 1961]).as("published-safe"),
Field("published").logicalMaximum([Constant(1960), 1961]).as("publishedSafe"),
])
.sort([Field("title").ascending()])
.limit(3)

let snapshot = try await pipeline.execute()

let expectedResults: [[String: Sendable]] = [
["title": "1984", "published-safe": 1961],
["title": "Crime and Punishment", "published-safe": 1961],
["title": "Dune", "published-safe": 1965],
["title": "1984", "publishedSafe": 1961],
["title": "Crime and Punishment", "publishedSafe": 1961],
["title": "Dune", "publishedSafe": 1965],
]

TestHelper.compare(snapshot: snapshot, expected: expectedResults, enforceOrder: true)
Expand All @@ -1640,17 +1640,17 @@ class PipelineIntegrationTests: FSTIntegrationTestCase {
.collection(collRef.path)
.select([
Field("title"),
Field("published").logicalMinimum([Constant(1960), 1961]).as("published-safe"),
Field("published").logicalMinimum([Constant(1960), 1961]).as("publishedSafe"),
])
.sort([Field("title").ascending()])
.limit(3)

let snapshot = try await pipeline.execute()

let expectedResults: [[String: Sendable]] = [
["title": "1984", "published-safe": 1949],
["title": "Crime and Punishment", "published-safe": 1866],
["title": "Dune", "published-safe": 1960],
["title": "1984", "publishedSafe": 1949],
["title": "Crime and Punishment", "publishedSafe": 1866],
["title": "Dune", "publishedSafe": 1960],
]

TestHelper.compare(snapshot: snapshot, expected: expectedResults, enforceOrder: true)
Expand All @@ -1665,17 +1665,17 @@ class PipelineIntegrationTests: FSTIntegrationTestCase {
.select([
Field("title"),
Field("published").lessThan(1960).then(Constant(1960), else: Field("published"))
.as("published-safe"),
.as("publishedSafe"),
])
.sort([Field("title").ascending()])
.limit(3)

let snapshot = try await pipeline.execute()

let expectedResults: [[String: Sendable]] = [
["title": "1984", "published-safe": 1960],
["title": "Crime and Punishment", "published-safe": 1960],
["title": "Dune", "published-safe": 1965],
["title": "1984", "publishedSafe": 1960],
["title": "Crime and Punishment", "publishedSafe": 1960],
["title": "Dune", "publishedSafe": 1965],
]

TestHelper.compare(snapshot: snapshot, expected: expectedResults, enforceOrder: true)
Expand Down Expand Up @@ -2755,8 +2755,8 @@ class PipelineIntegrationTests: FSTIntegrationTestCase {
let snapshot = try await pipeline.execute()

let expectedResults: [[String: Sendable?]] = [
["title": "The Hitchhiker's Guide to the Galaxy", "awards.hugo": true],
["title": "Dune", "awards.hugo": true],
["title": "The Hitchhiker's Guide to the Galaxy", "awards": ["hugo": true]],
["title": "Dune", "awards": ["hugo": true]],
]

TestHelper.compare(snapshot: snapshot, expected: expectedResults, enforceOrder: true)
Expand All @@ -2783,10 +2783,13 @@ class PipelineIntegrationTests: FSTIntegrationTestCase {
let expectedResultsArray: [[String: Sendable?]] = [
[
"title": "The Hitchhiker's Guide to the Galaxy",
"nestedField": ["level": [String: Any]()],
"nested": true,
],
[
"title": "Dune",
"nestedField": ["level": [String: Any]()],
"nested": nil,
],
]
TestHelper.compare(
Expand Down
Loading