Skip to content

Basic task impl + test fixes#198

Open
alexander-ignatow wants to merge 1 commit intomate-academy:masterfrom
alexander-ignatow:develop
Open

Basic task impl + test fixes#198
alexander-ignatow wants to merge 1 commit intomate-academy:masterfrom
alexander-ignatow:develop

Conversation

@alexander-ignatow
Copy link
Copy Markdown

Added a new test to verify the HTML form is shown on GET / in [formDataServer.test.js:43]
Why: README requires the app to show an HTML form with date, title, and amount fields. The previous suite did not test this requirement at all.

Updated endpoint naming in test titles from POST /submit-expense to POST /add-expense in [formDataServer.test.js:54] and [formDataServer.test.js:71]
Why: The test names were inconsistent with the actual request path used in the tests. This removes ambiguity and improves task clarity.

Strengthened the invalid input test to assert HTTP 400 status in [formDataServer.test.js:84], and updated assertion count in [formDataServer.test.js:79].
Why: The previous test only checked that some response text existed. Explicit status validation makes failure behavior deterministic and aligned with expected rejection semantics.

Reworked the response-format test from JSON API behavior to HTML behavior with formatted JSON in [formDataServer.test.js:91].
Why: README explicitly says the server should return an HTML page with well-formatted JSON. The old test required application/json and raw object equality, which contradicted README.

Changed POST payload in the HTML-response test to application/x-www-form-urlencoded using querystring in [formDataServer.test.js:9].
Why: This better reflects real browser form submission and validates the form-data path described by the task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant