-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kevin Cai
authored and
Kevin Cai
committed
Oct 11, 2023
1 parent
5ac7dc1
commit 0c2e2a5
Showing
10 changed files
with
164 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
/* eslint-disable no-console */ | ||
// | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* eslint-disable no-console */ | ||
// | ||
|
||
import { | ||
fetchOrders, | ||
fetchOrderByUUID, | ||
getOrdersByUserId, | ||
getOrderById, | ||
toggleOrderProgress, | ||
updateAllOrdersProgressToTrue, | ||
} from '../order_queries'; // Replace './your-module' with the actual path to your module | ||
|
||
// Test fetching all orders | ||
export async function testFetchOrders() { | ||
try { | ||
const result = await fetchOrders(); | ||
console.log('Fetch Orders Result:', result); | ||
} catch (error) { | ||
console.error('Test Fetch Orders Error:', error); | ||
} | ||
} | ||
|
||
// Test fetching an order by UUID | ||
export async function testFetchOrderByUUID() { | ||
const uuid = 'SAMPLE_ORDER_ID'; // Replace with a valid order ID | ||
try { | ||
const result = await fetchOrderByUUID(uuid); | ||
console.log('Fetch Order by UUID Result:', result); | ||
} catch (error) { | ||
console.error('Test Fetch Order by UUID Error:', error); | ||
} | ||
} | ||
|
||
// Test fetching orders by user ID | ||
export async function testGetOrdersByUserId() { | ||
const userId = '3b4a1317-b9ea-4cbd-95d7-e959aa80d1ea'; // Replace with a valid user ID | ||
try { | ||
const result = await getOrdersByUserId(userId); | ||
console.log('Get Orders by User ID Result:', result); | ||
} catch (error) { | ||
console.error('Test Get Orders by User ID Error:', error); | ||
} | ||
} | ||
|
||
// Test fetching an order by ID | ||
export async function testGetOrderById() { | ||
const orderId = '2'; // Replace with a valid order ID | ||
try { | ||
const result = await getOrderById(orderId); | ||
console.log('Get Order by ID Result:', result); | ||
} catch (error) { | ||
console.error('Test Get Order by ID Error:', error); | ||
} | ||
} | ||
|
||
// Test toggling order progress | ||
export async function testToggleOrderProgress() { | ||
const orderId = '2'; // Replace with a valid order ID | ||
try { | ||
const result = await toggleOrderProgress(orderId); | ||
console.log('Toggle Order Progress Result:', result); | ||
} catch (error) { | ||
console.error('Test Toggle Order Progress Error:', error); | ||
} | ||
} | ||
|
||
// Test updating all orders' progress to true | ||
export async function testUpdateAllOrdersProgressToTrue() { | ||
try { | ||
const result = await updateAllOrdersProgressToTrue(); | ||
console.log('Update All Orders Progress Result:', result); | ||
} catch (error) { | ||
console.error('Test Update All Orders Progress Error:', error); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* eslint-disable no-console */ | ||
// | ||
|
||
import { | ||
fetchPickupData, | ||
fetchPickupTimesByUUID, | ||
} from '../pickup_queries'; // Replace './your-module' with the actual path to your module | ||
|
||
// Test fetching data | ||
export async function testFetchPickupData() { | ||
try { | ||
const result = await fetchPickupData(); | ||
console.log('Fetch Data Result:', result); | ||
} catch (error) { | ||
console.error('Test Fetch Data Error:', error); | ||
} | ||
} | ||
|
||
// Test fetching pickup times by UUID | ||
export async function testFetchPickupTimesByUUID() { | ||
const uuid = '1'; // Replace with a valid UUID | ||
try { | ||
const result = await fetchPickupTimesByUUID(uuid); | ||
console.log('Fetch Pickup Times by UUID Result:', result); | ||
} catch (error) { | ||
console.error('Test Fetch Pickup Times by UUID Error:', error); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* eslint-disable no-console */ | ||
// | ||
|
||
import { | ||
fetchProducts, | ||
fetchProductByID, | ||
} from '../product_queries'; // Replace './your-module' with the actual path to your module | ||
|
||
// Test fetching all products | ||
export async function testFetchProducts() { | ||
try { | ||
const result = await fetchProducts(); | ||
console.log('Fetch Products Result:', result); | ||
} catch (error) { | ||
console.error('Test Fetch Products Error:', error); | ||
} | ||
} | ||
|
||
// Test fetching a product by name | ||
export async function testFetchProductByName() { | ||
const productId = '1'; // Replace with a valid product name | ||
try { | ||
const result = await fetchProductByID(productId); | ||
console.log('Fetch Product by Name Result:', result); | ||
} catch (error) { | ||
console.error('Test Fetch Product by Name Error:', error); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters