Skip to content

Commit d4d7fdb

Browse files
test: update outdated tests, remove unnecessary NODE_PATH passed to jest (#1910)
1 parent be64868 commit d4d7fdb

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
"dashboard": "node ./Parse-Dashboard/index.js & webpack --config webpack/build.config.js --progress --watch",
125125
"pig": "http-server ./PIG -p 4041 -s & webpack --config webpack/PIG.config.js --progress --watch",
126126
"build": "cross-env NODE_ENV=production webpack --config webpack/production.config.js && webpack --config webpack/PIG.config.js",
127-
"test": "cross-env NODE_PATH=./node_modules jest",
127+
"test": "jest",
128128
"lint": "eslint . --ignore-path .gitignore --cache",
129129
"pretest": "npm run lint",
130130
"generate": "node scripts/generate.js",

src/lib/tests/Authentication.test.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ function createAuthenticationResult(isAuthenticated, matchingUsername, appsUserH
5454
isAuthenticated,
5555
matchingUsername,
5656
appsUserHasAccessTo,
57-
isReadOnly
57+
isReadOnly,
58+
otpMissing: false,
59+
otpValid: true
5860
}
5961
}
6062

src/lib/tests/ColumnPreferences.test.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ describe('ColumnPreferences', () => {
4343
it('can retrive column orderings', () => {
4444
ColumnPreferences.updatePreferences([{ name: 'objectId', width: 100 }, { name: 'createdAt', width: 150 }], 'testapp', 'Klass');
4545
expect(ColumnPreferences.getOrder({ objectId: {}, createdAt: {} }, 'testapp', 'Klass')).toEqual(
46-
[{ name: 'objectId', width: 100, visible: true }, { name: 'createdAt', width: 150, visible: true }]
46+
[{ cached: true, required: false, name: 'objectId', width: 100, visible: true }, { cached: true, required: false, name: 'createdAt', width: 150, visible: true }]
4747
);
4848
});
4949

5050
it('tacks unknown columns onto the end', () => {
5151
ColumnPreferences.updatePreferences([{ name: 'objectId', width: 100 }, { name: 'createdAt', width: 150 }], 'testapp', 'Klass');
5252
expect(ColumnPreferences.getOrder({ objectId: {}, updatedAt: {}, createdAt: {}, someField: {} }, 'testapp', 'Klass')).toEqual(
53-
[{ name: 'objectId', width: 100, visible: true }, { name: 'createdAt', width: 150, visible: true }, { name: 'updatedAt', width: 150, visible: true }, { name: 'someField', width: 150, visible: true }]
53+
[{ cached: true, required: false, name: 'objectId', width: 100, visible: true }, { cached: true, required: false, name: 'createdAt', width: 150, visible: true }, { cached: true, required: false, name: 'updatedAt', width: 150, visible: true }, { cached: true, required: false, name: 'someField', width: 150, visible: true }]
5454
);
5555
expect(ColumnPreferences.getPreferences('testapp', 'Klass')).toEqual(
56-
[{ name: 'objectId', width: 100, visible: true }, { name: 'createdAt', width: 150, visible: true }, { name: 'updatedAt', width: 150, visible: true }, { name: 'someField', width: 150, visible: true }]
56+
[{ cached: true, required: false, name: 'objectId', width: 100, visible: true }, { cached: true, required: false, name: 'createdAt', width: 150, visible: true }, { cached: true, required: false, name: 'updatedAt', width: 150, visible: true }, { cached: true, required: false, name: 'someField', width: 150, visible: true }]
5757
);
5858
});
5959

@@ -64,17 +64,17 @@ describe('ColumnPreferences', () => {
6464
'Klass'
6565
);
6666
expect(ColumnPreferences.getOrder({ objectId: {}, createdAt: {}, updatedAt: {} }, 'testapp', 'Klass')).toEqual(
67-
[{ name: 'objectId', width: 100, visible: true }, { name: 'createdAt', width: 150, visible: true }, { name: 'updatedAt', width: 150, visible: true }]
67+
[{ cached: true, required: false, name: 'objectId', width: 100, visible: true }, { cached: true, required: false, name: 'createdAt', width: 150, visible: true }, { cached: true, required: false, name: 'updatedAt', width: 150, visible: true }]
6868
);
6969
expect(ColumnPreferences.getPreferences('testapp', 'Klass')).toEqual(
70-
[{ name: 'objectId', width: 100, visible: true }, { name: 'createdAt', width: 150, visible: true }, { name: 'updatedAt', width: 150, visible: true }]
70+
[{ cached: true, required: false, name: 'objectId', width: 100, visible: true }, { cached: true, required: false, name: 'createdAt', width: 150, visible: true }, { cached: true, required: false, name: 'updatedAt', width: 150, visible: true }]
7171
);
7272

7373
expect(ColumnPreferences.getOrder({ objectId: {}, updatedAt: {}, someField: {} }, 'testapp', 'Klass')).toEqual(
74-
[{ name: 'objectId', width: 100, visible: true }, { name: 'updatedAt', width: 150, visible: true }, { name: 'someField', width: 150, visible: true }]
74+
[{ cached: true, required: false, name: 'objectId', width: 100, visible: true }, { cached: true, required: false, name: 'updatedAt', width: 150, visible: true }, { cached: true, required: false, name: 'someField', width: 150, visible: true }]
7575
);
7676
expect(ColumnPreferences.getPreferences('testapp', 'Klass')).toEqual(
77-
[{ name: 'objectId', width: 100, visible: true }, { name: 'updatedAt', width: 150, visible: true }, { name: 'someField', width: 150, visible: true }]
77+
[{ cached: true, required: false, name: 'objectId', width: 100, visible: true }, { cached: true, required: false, name: 'updatedAt', width: 150, visible: true }, { cached: true, required: false, name: 'someField', width: 150, visible: true }]
7878
);
7979
});
8080
});

0 commit comments

Comments
 (0)