<commit_before>@mink:selenium
Feature: Patient Episodes
	In order to manage patients in OpenEyes
	As a OpenEyes user
	I need to be able to create, view and edit events and episodes

	Background:
		Given I am logged in as "admin:admin:Enoch:Root"

	Scenario: Patient with no episodes
		Given I am on "/patient/view/10057"
		When I follow "Create or View Episodes and Events"
		Then I should see "There are currently no episodes for this patient, please add a new event to open an episode." in the "div.alertBox" element
		And I should not see an "#episodes_sidebar .episode_nav" element
		And I should see "No Episodes for this patient"

	Scenario: Patient with episodes
		Given I am on "/patient/view/19434"
		When I follow "Create or View Episodes and Events"
		Then I should not see an "div.alertBox" element
		And I should see an "#episodes_sidebar .episode_nav" element
		And I should not see "No Episodes for this patient"

	Scenario: Add new event dropdown open
		Given I am on "/patient/view/10057"
		When I follow "Create or View Episodes and Events"
		And I press "addNewEvent"
		Then I should see an "#add-event-select-type" element on screen

	Scenario: Add new event dropdown close
		Given I am on "/patient/view/10057"
		When I follow "Create or View Episodes and Events"
		And I press "addNewEvent"
		And I press "addNewEvent"
		Then I should not see an "#add-event-select-type" element on screen<commit_msg>[OE-2535] fixed bug in patient_episodes feature<commit_after>Feature: Patient Episodes
	In order to manage patients in OpenEyes
	As a OpenEyes user
	I need to be able to create, view and edit events and episodes

	Background:
		Given I am logged in as "admin:admin:Enoch:Root"

	Scenario: Patient with no episodes
		Given I am on "/patient/view/10057"
		When I follow "Create or View Episodes and Events"
		Then I should see "There are currently no episodes for this patient, please add a new event to open an episode." in the "div.alertBox" element
		And I should not see an "#episodes_sidebar .episode_nav" element
		And I should see "No Episodes for this patient"

	Scenario: Patient with episodes
		Given I am on "/patient/view/19434"
		When I follow "Create or View Episodes and Events"
		Then I should not see an "div.alertBox" element
		And I should see an "#episodes_sidebar .episode_nav" element
		And I should not see "No Episodes for this patient"

	Scenario: Add new event dropdown open
		Given I am on "/patient/view/10057"
		When I follow "Create or View Episodes and Events"
		And I press "addNewEvent"
		Then I should see an "#add-event-select-type" element on screen

	Scenario: Add new event dropdown close
		Given I am on "/patient/view/10057"
		When I follow "Create or View Episodes and Events"
		And I press "addNewEvent"
		And I wait "0.5" seconds
		And I press "addNewEvent"
		And I wait "0.5" seconds
		Then I should not see an "#add-event-select-type" element on screen
{'fraction_non_alphanumeric': 0.06067877956804937, 'fraction_numerical': 0.0164552622557422, 'mean_word_length': 3.879598662207358, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1764402', 'n_tokens_mistral': 979, 'n_tokens_neox': 874, 'n_words': 439}