File tree Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Expand file tree Collapse file tree 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import * as dgraph from "../src";
2
2
3
3
export const SERVER_ADDR = "http://localhost:8080" ; // tslint:disable-line no-http-string
4
4
export const USE_LEGACY_API = false ;
5
- export const DEFAULT_NAMESPACE = 0 ;
6
5
7
6
export function createClient ( ) : dgraph . DgraphClient {
8
7
return new dgraph . DgraphClient (
@@ -28,9 +27,9 @@ export async function setup(
28
27
const c = createClient ( ) ;
29
28
if ( ! USE_LEGACY_API ) {
30
29
if ( userid === undefined ) {
31
- await c . loginIntoNamespace ( "groot" , "password" , DEFAULT_NAMESPACE ) ;
30
+ await c . login ( "groot" , "password" ) ;
32
31
} else {
33
- await c . loginIntoNamespace ( userid , password , DEFAULT_NAMESPACE ) ;
32
+ await c . login ( userid , password ) ;
34
33
}
35
34
}
36
35
await dropAll ( c ) ;
Original file line number Diff line number Diff line change 1
1
import { setSchema , setup , USE_LEGACY_API } from "../helper" ;
2
2
3
3
const data = [ "200" , "300" , "400" ] ;
4
- const DEFAULT_NAMESPACE = 0 ;
5
4
6
5
describe ( "ACL Login" , ( ) => {
7
6
it ( "should login and use JWT tokens" , async ( ) => {
@@ -12,21 +11,17 @@ describe("ACL Login", () => {
12
11
13
12
const client = await setup ( "groot" , "password" ) ;
14
13
15
- await client . loginIntoNamespace ( "groot" , "password" , DEFAULT_NAMESPACE ) ;
14
+ await client . login ( "groot" , "password" ) ;
16
15
17
16
try {
18
- await client . loginIntoNamespace (
19
- "groot" ,
20
- "12345678" ,
21
- DEFAULT_NAMESPACE ,
22
- ) ;
17
+ await client . login ( "groot" , "12345678" ) ;
23
18
throw new Error ( "Server should not accept wrong password" ) ;
24
19
} catch ( e ) {
25
20
// Expected to throw an error for wrong password.
26
21
}
27
22
28
23
try {
29
- await client . loginIntoNamespace ( "Groot" , "password" , DEFAULT_NAMESPACE ) ;
24
+ await client . login ( "Groot" , "password" ) ;
30
25
throw new Error ( "Server should not accept wrong userid" ) ;
31
26
} catch ( e ) {
32
27
// Expected to throw an error for wrong password.
You can’t perform that action at this time.
0 commit comments