Skip to content

Commit

Permalink
Remove key path listener test for embedded object.
Browse files Browse the repository at this point in the history
  • Loading branch information
elle-j committed Jul 10, 2024
1 parent 3cd14bf commit 830caa1
Showing 1 changed file with 0 additions and 57 deletions.
57 changes: 0 additions & 57 deletions integration-tests/tests/src/tests/observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -993,63 +993,6 @@ describe("Observable", () => {
);
});

it("fires on relevant changes to an embedded object", async function (this: RealmObjectContext<Person>) {
const collection = this.realm.objects("Person");

await expectCollectionNotifications(
collection,
["embeddedAddress"],
[
EMPTY_COLLECTION_CHANGESET,
() => {
this.realm.write(() => {
this.object.embeddedAddress = { street: "1633 Broadway", city: "New York" };
});
expect(this.object.embeddedAddress).deep.equals({ street: "1633 Broadway", city: "New York" });
},
{
deletions: [],
insertions: [],
newModifications: [0],
oldModifications: [0],
},
() => {
this.realm.write(() => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
this.object.embeddedAddress!.street = "88 Kearny Street";
});
expect(this.object.embeddedAddress?.street).equals("88 Kearny Street");
},
{
deletions: [],
insertions: [],
newModifications: [0],
oldModifications: [0],
},
() => {
this.realm.write(() => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
this.object.embeddedAddress!.city = "San Francisco";
});
expect(this.object.embeddedAddress?.city).equals("San Francisco");
},
{
deletions: [],
insertions: [],
newModifications: [0],
oldModifications: [0],
},
// Perform a couple of changes that shouldn't trigger the listener.
() => {
this.realm.write(() => {
this.object.name = "New Name";
});
expect(this.object.name).equals("New Name");
},
],
);
});

it("fires on relevant changes to a wildcard", async function (this: RealmObjectContext<Person>) {
const collection = this.realm.objects<Person>("Person").filtered("name = $0 OR age = 42", "Alice");
await expectCollectionNotifications(
Expand Down

0 comments on commit 830caa1

Please sign in to comment.