Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1620578

Browse files
ram2091999kumaran-14
authored andcommitted
Fix master to have linear history and be same as production branch
1 parent 093c7bb commit 1620578

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+1397
-480
lines changed

__tests__/app/components/EditPassword.test.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,22 @@ describe('EditPassword Component', () => {
1818
password={'password'}
1919
repeatPassword={'repeatPassword'}
2020
userDetails={{
21-
avatar: 'CRUNCH',
21+
avatar: '',
2222
college: '',
2323
country: 'IN',
2424
email: '',
2525
errorMessage: '',
2626
fullName: '',
2727
isAuthenticationOpen: true,
28-
isLoggedIn: true,
28+
isFirstLogin: true,
29+
isLoggedIn: false,
2930
isLoginLoading: false,
31+
isNotificationPresent: false,
32+
isSocketPresent: false,
3033
isUserProfileModalOpen: false,
34+
notification: '',
35+
socketMessage: '',
36+
userId: 0,
3137
userType: UserType.STUDENT,
3238
username: '',
3339
}}

__tests__/app/components/__snapshots__/EditPassword.test.tsx.snap

+8-2
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,22 @@ exports[`EditPassword Component Should render 1`] = `
137137
repeatPassword="repeatPassword"
138138
userDetails={
139139
Object {
140-
"avatar": "CRUNCH",
140+
"avatar": "",
141141
"college": "",
142142
"country": "IN",
143143
"email": "",
144144
"errorMessage": "",
145145
"fullName": "",
146146
"isAuthenticationOpen": true,
147-
"isLoggedIn": true,
147+
"isFirstLogin": true,
148+
"isLoggedIn": false,
148149
"isLoginLoading": false,
150+
"isNotificationPresent": false,
151+
"isSocketPresent": false,
149152
"isUserProfileModalOpen": false,
153+
"notification": "",
154+
"socketMessage": "",
155+
"userId": 0,
150156
"userType": "STUDENT",
151157
"username": "",
152158
}

__tests__/app/containers/EditorSettings.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('EditorSettings Container', () => {
3434
},
3535
});
3636

37-
expect(wrapper.find('select.theme-control').props().value).toBe('solarized_light');
37+
expect(wrapper.find('select.theme-control').props().value).toBe('monokai');
3838
wrapper.find('select.theme-control').simulate('change', { target: { value: 'github' } });
3939
expect(wrapper.find('select.theme-control').props().value).toBe('github');
4040
});

__tests__/app/containers/SideBar.test.tsx

+6-5
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ describe('SideBar Container', () => {
4949
});
5050

5151
it('Should Dispatch setSidePanelTab Notification or None', () => {
52-
const button = wrapper.find('.notification-btn-ctrl').at(1);
53-
button.simulate('click');
54-
expect(wrapper.find(Sidebar).props().sidePanelTab).toBe(SidePanelTab.NOTIFICATION);
55-
button.simulate('click');
56-
expect(wrapper.find(Sidebar).props().sidePanelTab).toBe(SidePanelTab.NONE);
52+
// const button = wrapper.find('.notification-btn-ctrl').at(1);
53+
// button.simulate('click');
54+
// TODO: Remove this.
55+
// expect(wrapper.find(Sidebar).props().sidePanelTab).toBe(SidePanelTab.NOTIFICATION);
56+
// button.simulate('click');
57+
// expect(wrapper.find(Sidebar).props().sidePanelTab).toBe(SidePanelTab.NONE);
5758
});
5859
});

__tests__/app/containers/__snapshots__/Editor.test.tsx.snap

+24-18
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,20 @@ exports[`Editor Container Should render Editor 1`] = `
3535
// Bots can move to any reachable location on the map.
3636
// Let's make bots move to all flag locations
3737
38-
// You can use auto instead of an explicit type
3938
size_t used_bots = 0;
4039
4140
// Range based loops are convenient to use. We use a reference to
4241
// ensure that our changes are reflected and not made on a copy!
42+
// You can use auto instead of an explicit type
4343
for (auto &bot : state.bots) {
44-
// Let's not use up all our bots just for this operation. So, we will
45-
// only use a maximum of 18 bots here.
46-
if (used_bots >= state.flag_offsets.size() || used_bots >= 18)
44+
// Let's not use up all our bots just for these. So, we will only use a
45+
// maximum of 18 bots here.
46+
if (used_bots > state.flag_offsets.size() || used_bots >= 18)
4747
break;
4848
49+
// Make sure that you do not access a vector beyond it's size or else,
50+
// you'll get a segmentation fault and cost you the entire game
51+
4952
// State has a vector that has the locations of flag locations on the
5053
// map. A bot asked to move to a location will automatically go
5154
// there using the shortest path found and start mining for gold.
@@ -58,19 +61,27 @@ exports[`Editor Container Should render Editor 1`] = `
5861
5962
// Before that we ensure that we have atleast one extra bot left
6063
if (state.bots.size() > used_bots) {
61-
// See the usage of constant value PLAYER2_BASE_POSITION
62-
state.bots[used_bots].blast(PLAYER2_BASE_POSITION);
64+
// See the usage of constant value PLAYER_BASE_POSITIONS
65+
state.bots[used_bots].blast(PLAYER_BASE_POSITIONS[1]);
6366
used_bots++;
6467
}
6568
6669
// Other than blasting and moving, bots can also transform into towers
67-
// Let's try to transform one of the bots near the other end of
68-
// the map i.e., (MAP_SIZE - 2, MAP_SIZE - 2) Note that you cannot construct
69-
// or move to coordinates where either x = MAP_SIZE or y = MAP_SIZE
70+
// Let's try to transform all of the remaining bots near the other end of
71+
// the map i.e., (MAP_SIZE - 1, MAP_SIZE - 1) Note that you cannot construct
72+
// / move to coordinates where either x = MAP_SIZE or y = MAP_SIZE
73+
int x = MAP_SIZE - 2, y = MAP_SIZE - 2;
7074
7175
// The bots can also be traversed like a usual array using an index
72-
for (size_t i = used_bots; i < used_bots + 1; i++) {
73-
state.bots[i].transform(DoubleVec2D(MAP_SIZE - 2, MAP_SIZE - 2));
76+
for (size_t i = used_bots; i < state.bots.size(); i++) {
77+
if (y != (MAP_SIZE - 1)) {
78+
79+
// You can use the DoubleVec2D class to define positions and
80+
// distances
81+
state.bots[i].transform(DoubleVec2D(x, y));
82+
x--;
83+
y++;
84+
}
7485
}
7586
7687
// State also has the vector of player towers
@@ -91,15 +102,10 @@ exports[`Editor Container Should render Editor 1`] = `
91102
// all there is to State and we have some helper snippets and methods
92103
// so you start competing right away!
93104
94-
for (auto &bot : state.bots) {
95-
logr << bot.position << endl;
96-
}
97-
98105
return state;
99106
}
100107
101-
} // namespace player_code
102-
"
108+
}"
103109
editorWidth={400}
104110
enableBasicAutoCompletion={true}
105111
enableSnippets={true}
@@ -109,7 +115,7 @@ exports[`Editor Container Should render Editor 1`] = `
109115
isLoggedIn={false}
110116
keyboardHandler="default"
111117
save={[Function]}
112-
theme="solarized_light"
118+
theme="monokai"
113119
updateCode={[Function]}
114120
viewOnly={false}
115121
/>

__tests__/app/containers/__snapshots__/EditorSettings.test.tsx.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ exports[`EditorSettings Container Should render EditorSettings 1`] = `
1010
enableSnippets={true}
1111
fontSize={16}
1212
keyboardHandler="default"
13-
theme="solarized_light"
13+
theme="monokai"
1414
toggleBasicAutoCompletion={[Function]}
1515
toggleSnippets={[Function]}
1616
>
@@ -208,7 +208,7 @@ exports[`EditorSettings Container Should render EditorSettings 1`] = `
208208
<select
209209
className="form-control theme-control"
210210
onChange={[Function]}
211-
value="solarized_light"
211+
value="monokai"
212212
>
213213
<option
214214
key="monokai"

0 commit comments

Comments
 (0)