Skip to content

Commit

Permalink
tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
lowtorola committed Jun 25, 2023
1 parent 23fb4da commit 83a91ac
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions frontend2/src/__test__/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { describe, expect, test } from "@jest/globals";
import { ApiApi } from "../utils/types";
import { ApiUnsafe, Auth } from "../utils/api";
import { Api, Auth } from "../utils/api";

const API = new ApiApi("http://localhost:8000");

//---- AUTHORIZATION ----//
// TEST 1: Generate/Verify API Access Token
// This test should work, called "login" in safe API //
test("API: Generate/Verify API Access Token (STABLE)", async () => {
test("API: Generate/Verify API Access Token", async () => {
const request = {
username: "lmtorola_test",
password: "pass",
Expand Down Expand Up @@ -39,13 +39,13 @@ test("API: Generate/Verify API Access Token (STABLE)", async () => {

//---- USER ----//
// TEST 1: Get current user's info (authed)
test("API: Get current user's info (authed) (UNSTABLE)", async () => {
await Auth.login("lmtorola_test", "pass");
Auth.setLoginHeader();
await ApiUnsafe.getUserUserProfile().then((res) => {
expect(res.username).toEqual("lmtorola_test");
});
});
// test("API: Get current user's info (authed) (UNSTABLE)", async () => {
// await Auth.login("lmtorola_test", "pass");
// Auth.setLoginHeader();
// await Api.getUserUserProfile().then((res) => {
// expect(res.username).toEqual("lmtorola_test");
// });
// });

// TEST 2: Get current user's info (unauthed)

Expand Down

0 comments on commit 83a91ac

Please sign in to comment.