def METHOD_NAME(mocker, modal_dialog):
    assert modal_dialog.header_animation
    modal_dialog.header_animation.start = mocker.MagicMock()
    modal_dialog.header_animation.stop = mocker.MagicMock()
    modal_dialog.header_icon.setVisible = mocker.MagicMock()
    modal_dialog.header_spinner_label.setVisible = mocker.MagicMock()
    modal_dialog.header_spinner_label.setPixmap = mocker.MagicMock()
    # Check the animation frame is updated as expected.
    modal_dialog.animate_header()
    assert modal_dialog.header_spinner_label.setPixmap.call_count == 1
    # Check starting the animated state works as expected.
    modal_dialog.start_animate_header()
    modal_dialog.header_animation.start.assert_called_once_with()
    modal_dialog.header_icon.setVisible.assert_called_once_with(False)
    modal_dialog.header_spinner_label.setVisible.assert_called_once_with(True)
    modal_dialog.header_icon.setVisible.reset_mock()
    modal_dialog.header_spinner_label.setVisible.reset_mock()
    # Check stopping the animated state works as expected.
    modal_dialog.stop_animate_header()
    modal_dialog.header_animation.stop.assert_called_once_with()
    modal_dialog.header_icon.setVisible.assert_called_once_with(True)
    modal_dialog.header_spinner_label.setVisible.assert_called_once_with(False)