description: entity-client-cmap-events

schemaVersion: '1.3'

createEntities:
  - client:
      id: &client0 client0
      useMultipleMongoses: true
      observeEvents:
        - connectionReadyEvent
        - connectionCheckedOutEvent
        - connectionCheckedInEvent
  - database:
      id: &database0 database0
      client: *client0
      databaseName: &database0Name database0Name
  - collection:
      id: &collection0 collection0
      database: *database0
      collectionName: &collection0Name coll0

initialData:
  - collectionName: *collection0Name
    databaseName: *database0Name
    documents: []

tests:
  - description: events are captured during an operation
    operations:
      - name: insertOne
        object: *collection0
        arguments:
          document: { x: 1 }
    expectEvents:
      - client: *client0
        eventType: cmap
        events:
          - connectionReadyEvent: {}
          - connectionCheckedOutEvent: {}
          - connectionCheckedInEvent: {}
