Skip to content

Commit 5669699

Browse files
Add spec test for limit query initialization (#683)
1 parent 33d656e commit 5669699

File tree

1 file changed

+265
-0
lines changed

1 file changed

+265
-0
lines changed

firebase-firestore/src/test/resources/json/limit_spec_test.json

Lines changed: 265 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,6 +1566,271 @@
15661566
}
15671567
]
15681568
},
1569+
"Initial snapshots for limit queries are re-filled from cache": {
1570+
"describeName": "Limits:",
1571+
"itName": "Initial snapshots for limit queries are re-filled from cache",
1572+
"tags": [],
1573+
"config": {
1574+
"useGarbageCollection": false,
1575+
"numClients": 1
1576+
},
1577+
"steps": [
1578+
{
1579+
"userListen": [
1580+
2,
1581+
{
1582+
"path": "collection",
1583+
"filters": [
1584+
[
1585+
"matches",
1586+
"==",
1587+
true
1588+
]
1589+
],
1590+
"orderBys": []
1591+
}
1592+
],
1593+
"stateExpect": {
1594+
"activeTargets": {
1595+
"2": {
1596+
"query": {
1597+
"path": "collection",
1598+
"filters": [
1599+
[
1600+
"matches",
1601+
"==",
1602+
true
1603+
]
1604+
],
1605+
"orderBys": []
1606+
},
1607+
"resumeToken": ""
1608+
}
1609+
}
1610+
}
1611+
},
1612+
{
1613+
"watchAck": [
1614+
2
1615+
]
1616+
},
1617+
{
1618+
"watchEntity": {
1619+
"docs": [
1620+
{
1621+
"key": "collection/a",
1622+
"version": 1001,
1623+
"value": {
1624+
"matches": true
1625+
},
1626+
"options": {
1627+
"hasLocalMutations": false,
1628+
"hasCommittedMutations": false
1629+
}
1630+
},
1631+
{
1632+
"key": "collection/b",
1633+
"version": 1002,
1634+
"value": {
1635+
"matches": true
1636+
},
1637+
"options": {
1638+
"hasLocalMutations": false,
1639+
"hasCommittedMutations": false
1640+
}
1641+
},
1642+
{
1643+
"key": "collection/c",
1644+
"version": 1003,
1645+
"value": {
1646+
"matches": true
1647+
},
1648+
"options": {
1649+
"hasLocalMutations": false,
1650+
"hasCommittedMutations": false
1651+
}
1652+
}
1653+
],
1654+
"targets": [
1655+
2
1656+
]
1657+
}
1658+
},
1659+
{
1660+
"watchCurrent": [
1661+
[
1662+
2
1663+
],
1664+
"resume-token-1003"
1665+
]
1666+
},
1667+
{
1668+
"watchSnapshot": {
1669+
"version": 1003,
1670+
"targetIds": []
1671+
},
1672+
"expect": [
1673+
{
1674+
"query": {
1675+
"path": "collection",
1676+
"filters": [
1677+
[
1678+
"matches",
1679+
"==",
1680+
true
1681+
]
1682+
],
1683+
"orderBys": []
1684+
},
1685+
"added": [
1686+
{
1687+
"key": "collection/a",
1688+
"version": 1001,
1689+
"value": {
1690+
"matches": true
1691+
},
1692+
"options": {
1693+
"hasLocalMutations": false,
1694+
"hasCommittedMutations": false
1695+
}
1696+
},
1697+
{
1698+
"key": "collection/b",
1699+
"version": 1002,
1700+
"value": {
1701+
"matches": true
1702+
},
1703+
"options": {
1704+
"hasLocalMutations": false,
1705+
"hasCommittedMutations": false
1706+
}
1707+
},
1708+
{
1709+
"key": "collection/c",
1710+
"version": 1003,
1711+
"value": {
1712+
"matches": true
1713+
},
1714+
"options": {
1715+
"hasLocalMutations": false,
1716+
"hasCommittedMutations": false
1717+
}
1718+
}
1719+
],
1720+
"errorCode": 0,
1721+
"fromCache": false,
1722+
"hasPendingWrites": false
1723+
}
1724+
]
1725+
},
1726+
{
1727+
"userUnlisten": [
1728+
2,
1729+
{
1730+
"path": "collection",
1731+
"filters": [
1732+
[
1733+
"matches",
1734+
"==",
1735+
true
1736+
]
1737+
],
1738+
"orderBys": []
1739+
}
1740+
],
1741+
"stateExpect": {
1742+
"activeTargets": {}
1743+
}
1744+
},
1745+
{
1746+
"userSet": [
1747+
"collection/a",
1748+
{
1749+
"matches": false
1750+
}
1751+
]
1752+
},
1753+
{
1754+
"userListen": [
1755+
4,
1756+
{
1757+
"path": "collection",
1758+
"limit": 2,
1759+
"filters": [
1760+
[
1761+
"matches",
1762+
"==",
1763+
true
1764+
]
1765+
],
1766+
"orderBys": []
1767+
}
1768+
],
1769+
"stateExpect": {
1770+
"activeTargets": {
1771+
"4": {
1772+
"query": {
1773+
"path": "collection",
1774+
"limit": 2,
1775+
"filters": [
1776+
[
1777+
"matches",
1778+
"==",
1779+
true
1780+
]
1781+
],
1782+
"orderBys": []
1783+
},
1784+
"resumeToken": ""
1785+
}
1786+
}
1787+
},
1788+
"expect": [
1789+
{
1790+
"query": {
1791+
"path": "collection",
1792+
"limit": 2,
1793+
"filters": [
1794+
[
1795+
"matches",
1796+
"==",
1797+
true
1798+
]
1799+
],
1800+
"orderBys": []
1801+
},
1802+
"added": [
1803+
{
1804+
"key": "collection/b",
1805+
"version": 1002,
1806+
"value": {
1807+
"matches": true
1808+
},
1809+
"options": {
1810+
"hasLocalMutations": false,
1811+
"hasCommittedMutations": false
1812+
}
1813+
},
1814+
{
1815+
"key": "collection/c",
1816+
"version": 1003,
1817+
"value": {
1818+
"matches": true
1819+
},
1820+
"options": {
1821+
"hasLocalMutations": false,
1822+
"hasCommittedMutations": false
1823+
}
1824+
}
1825+
],
1826+
"errorCode": 0,
1827+
"fromCache": true,
1828+
"hasPendingWrites": false
1829+
}
1830+
]
1831+
}
1832+
]
1833+
},
15691834
"Resumed limit queries exclude deleted documents ": {
15701835
"describeName": "Limits:",
15711836
"itName": "Resumed limit queries exclude deleted documents ",

0 commit comments

Comments
 (0)