1 |
|
2 |
|
3 |
|
4 |
|
5 | var util = require( './util' );
|
6 | var assert = require( 'assert' );
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | describe( 'wpcom.domain', function() {
|
13 |
|
14 | const wpcom = util.wpcom();
|
15 |
|
16 | describe( 'wpcom.domain.status', function() {
|
17 | it( 'should get the domain status', done => {
|
18 | wpcom
|
19 | .domain( 'dd32.me' )
|
20 | .status()
|
21 | .then( data => {
|
22 | assert.ok( data );
|
23 | done();
|
24 | } )
|
25 | .catch( done );
|
26 | } );
|
27 | } );
|
28 |
|
29 | describe( 'wpcom.domain.isAvailable', function() {
|
30 | it( 'should check that wordpress.com is not available', done => {
|
31 | wpcom
|
32 | .domain( 'wordpress.com' )
|
33 | .isAvailable()
|
34 | .then( data => {
|
35 | console.log( `-> data -> `, data );
|
36 |
|
37 | assert.ok( data );
|
38 | assert.equal( false, data.is_available );
|
39 | done();
|
40 | } )
|
41 | .catch( done );
|
42 | } );
|
43 | } );
|
44 |
|
45 | describe( 'wpcom.domain.isMappable', function() {
|
46 | it( 'should check that wordpress.com is not mappable', done => {
|
47 | wpcom
|
48 | .domain( 'wordpress.com' )
|
49 | .isMappable()
|
50 | .then( done )
|
51 | .catch( error => {
|
52 | assert.ok( error );
|
53 | done();
|
54 | } )
|
55 | } );
|
56 | } );
|
57 |
|
58 | describe( 'wpcom.domain.canRedirect', function() {
|
59 | it( 'should check if wordpress.com can be redirected', done => {
|
60 | wpcom
|
61 | .domain( 'retrofocs.wordpress.com' )
|
62 | .canRedirect( 'retrofox.me' )
|
63 | .then( done )
|
64 | .catch( error => {
|
65 | assert.ok( error );
|
66 | done();
|
67 | } )
|
68 | } );
|
69 | } );
|
70 |
|
71 | describe( 'wpcom.domain.emailForwards', function() {
|
72 | it( 'should get email forwards/configuration', done => {
|
73 | wpcom
|
74 | .domain( 'retrofox.me' )
|
75 | .emailForwards()
|
76 | .then( data => {
|
77 | assert.ok( data );
|
78 | assert.equal( 'number', typeof data.max_forwards );
|
79 | done();
|
80 | } )
|
81 | .catch( done );
|
82 | } );
|
83 | } );
|
84 |
|
85 | describe( 'wpcom.domain.nameserversList', function() {
|
86 | it( 'should get a list of nameservers', done => {
|
87 | wpcom
|
88 | .domain( 'retrofox.me' )
|
89 | .nameserversList()
|
90 | .then( data => {
|
91 | assert.ok( data );
|
92 | done();
|
93 | } )
|
94 | .catch( done );
|
95 | } );
|
96 | } );
|
97 |
|
98 | describe( 'wpcom.domain.dns', function() {
|
99 | it( 'should get a list of dns records', done => {
|
100 | wpcom
|
101 | .domain( 'wordpress.com' )
|
102 | .dnsList()
|
103 | .then( data => {
|
104 | assert.ok( data );
|
105 | done();
|
106 | } )
|
107 | .catch( done );
|
108 | } );
|
109 | } );
|
110 |
|
111 | describe( 'wpcom.domain.googleApps', function() {
|
112 | it( 'should get a list of google app accounts', done => {
|
113 | wpcom
|
114 | .domain( 'wordpress.com' )
|
115 | .googleAppsList()
|
116 | .then( data => {
|
117 | assert.ok( data );
|
118 | done();
|
119 | } )
|
120 | .catch( done );
|
121 | } );
|
122 | } );
|
123 | } );
|