Skip to content

Commit 1c4fd64

Browse files
committed
Use old login in tests
1 parent fd093e4 commit 1c4fd64

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

tests/helper.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as dgraph from "../src";
22

33
export const SERVER_ADDR = "http://localhost:8080"; // tslint:disable-line no-http-string
44
export const USE_LEGACY_API = false;
5-
export const DEFAULT_NAMESPACE = 0;
65

76
export function createClient(): dgraph.DgraphClient {
87
return new dgraph.DgraphClient(
@@ -28,9 +27,9 @@ export async function setup(
2827
const c = createClient();
2928
if (!USE_LEGACY_API) {
3029
if (userid === undefined) {
31-
await c.loginIntoNamespace("groot", "password", DEFAULT_NAMESPACE);
30+
await c.login("groot", "password");
3231
} else {
33-
await c.loginIntoNamespace(userid, password, DEFAULT_NAMESPACE);
32+
await c.login(userid, password);
3433
}
3534
}
3635
await dropAll(c);

tests/integration/acl.spec.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { setSchema, setup, USE_LEGACY_API } from "../helper";
22

33
const data = ["200", "300", "400"];
4-
const DEFAULT_NAMESPACE = 0;
54

65
describe("ACL Login", () => {
76
it("should login and use JWT tokens", async () => {
@@ -12,21 +11,17 @@ describe("ACL Login", () => {
1211

1312
const client = await setup("groot", "password");
1413

15-
await client.loginIntoNamespace("groot", "password", DEFAULT_NAMESPACE);
14+
await client.login("groot", "password");
1615

1716
try {
18-
await client.loginIntoNamespace(
19-
"groot",
20-
"12345678",
21-
DEFAULT_NAMESPACE,
22-
);
17+
await client.login("groot", "12345678");
2318
throw new Error("Server should not accept wrong password");
2419
} catch (e) {
2520
// Expected to throw an error for wrong password.
2621
}
2722

2823
try {
29-
await client.loginIntoNamespace("Groot", "password", DEFAULT_NAMESPACE);
24+
await client.login("Groot", "password");
3025
throw new Error("Server should not accept wrong userid");
3126
} catch (e) {
3227
// Expected to throw an error for wrong password.

0 commit comments

Comments
 (0)