From 49c79f3bbef6183b7b346199a055b4a5a9cc4edc Mon Sep 17 00:00:00 2001
From: Ignacio <ignacio@perezsmith.me>
Date: Wed, 23 Oct 2024 11:43:59 -0600
Subject: [PATCH] First Functional Test specced out in comments, Added unittest

---
 .gitignore          |  4 ++--
 functional_tests.py | 36 ++++++++++++++++++++++++++++++++----
 2 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/.gitignore b/.gitignore
index a69ac34..b54c323 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
 db.sqlite3
 .venv 
-"__pycache__" 
-"*.pyc" 
+__pycache__
+*.pyc
diff --git a/functional_tests.py b/functional_tests.py
index 1aa31f1..cb08aaf 100644
--- a/functional_tests.py
+++ b/functional_tests.py
@@ -1,7 +1,35 @@
+import unittest
 from selenium import webdriver
 
-browser = webdriver.Firefox()
-browser.get("http://localhost:8000")
+class NewVisitorTest(unittest.TestCase):
+  def setUp(self):
+    self.browser = webdriver.Firefox()
+  
+  def tearDown(self):
+    self.browser.quit()
+  
+  def test_can_start_a_todo_list(self):
+    # Ig has heard about a cool new online to-do app.
+    # He goes to check out its homepage
+    self.browser.get("http://localhost:8000")
+    # He notices the page title and header mention to-do lists
+    self.assertIn("To-Do", self.browser.title)
 
-assert "Congratulations!" in browser.title
-print("OK")
+    # He is invited to enter a to-do item straight away
+    self.fail("Finish the test!")
+
+    # He types "Buy peacock feathers" into a text box
+    # (Ig's hobby is tying fly-fishing lures)
+
+    # When he hits enter, the page updates, and now the page lists
+    # "1: Buy peacock feathers" as an item in a to-do list
+
+    # There is still a text box inviting him to add another item.
+    # He enters "Use peacock feathers to make a fly" (Ig is very methodical)
+
+    # The page updates again, and now shows both items on his list
+
+    # Satisfied, he goes back to sleep
+
+if __name__ == "__main__":
+  unittest.main()
\ No newline at end of file