Skip to content

Commit

Permalink
Merge pull request #2 from fac31/session-two
Browse files Browse the repository at this point in the history
updated session-two
  • Loading branch information
johnOlabhie authored May 7, 2024
2 parents d206f07 + efd203c commit 72597be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
5 changes: 0 additions & 5 deletions js-Pages/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ function storeAPIKey() {
// Store the API key in the global variable
globalApiKey = apiKey;

// Optionally, log to the console for verification (remove in production)
console.log("API Key stored successfully");

//clear text inout display

}

// Function to capture form data and send it to the OpenAI API
Expand Down
10 changes: 5 additions & 5 deletions js-Pages/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function testDisplayTextWithNoAPIKey() {
/**
* 2. Testing Successful API Call
*/

/*
function testDisplayTextWithAPIKey() {
// Setup: Set a test API key and simulate user input
globalApiKey = 'test-key';
Expand All @@ -100,7 +100,7 @@ function testDisplayTextWithAPIKey() {
window.fetch = originalFetch;
document.getElementById('input-text').value = "";
}

*?
/*----------------------------------------*\
#TEST: Successful API Response
\*----------------------------------------*/
Expand Down Expand Up @@ -144,11 +144,11 @@ window.addEventListener('load', function() {
testStoreAPIKeyFunction();

// Test the displayText function's behavior in both scenarios
testDisplayTextWithNoAPIKey();
testDisplayTextWithAPIKey();
// testDisplayTextWithNoAPIKey();
// testDisplayTextWithAPIKey();

// Test successful API response
testSuccessfulAPIResponse();
// testSuccessfulAPIResponse();
});


0 comments on commit 72597be

Please sign in to comment.