def METHOD_NAME(config: Mapping, configured_catalog: ConfiguredAirbyteCatalog, writer: FirestoreWriter):
    """
    This test verifies that writing a stream in "append" mode appends new records without deleting the old ones
    It checks also if the correct state message is output by the connector at the end of the sync
    """
    stream = configured_catalog.streams[0].stream.name
    destination = DestinationFirestore()
    state_message = _state({"state": "3"})
    record_chunk = [_record(stream, str(i), i) for i in range(1, 3)]
    output_states = list(destination.write(config, configured_catalog, [*record_chunk, state_message]))
    assert [state_message] == output_states
    records_in_destination = retrieve_all_records(writer.client)
    expected_records = [_record(stream, str(i), i) for i in range(1, 3)]
    assert expected_records == records_in_destination