{
  "description": "expectedEventsForClient-topologyDescriptionChangedEvent",
  "schemaVersion": "1.20",
  "runOnRequirements": [
    {
      "topologies": [
        "replicaset"
      ],
      "minServerVersion": "4.4"
    }
  ],
  "tests": [
    {
      "description": "can assert on values of newDescription and previousDescription fields",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "directConnection": true
                  },
                  "observeEvents": [
                    "topologyDescriptionChangedEvent"
                  ]
                }
              }
            ]
          }
        },
        {
          "name": "waitForEvent",
          "object": "testRunner",
          "arguments": {
            "client": "client",
            "event": {
              "topologyDescriptionChangedEvent": {}
            },
            "count": 1
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "eventType": "sdam",
          "ignoreExtraEvents": true,
          "events": [
            {
              "topologyDescriptionChangedEvent": {
                "previousDescription": {
                  "type": "Unknown"
                },
                "newDescription": {
                  "type": "Single"
                }
              }
            }
          ]
        }
      ]
    }
  ]
}
