Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathanbees committed Oct 16, 2024
2 parents 570a19c + 3a00b6a commit f4a9cb1
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 19 deletions.
2 changes: 1 addition & 1 deletion SoftServeAcademy/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"learning_route/update/<int:id>/",
learningRouteViews.update,
name="learning_route_update",
),
),
path(
"learning_route/<int:id>/",
learningRouteViews.detail,
Expand Down
4 changes: 2 additions & 2 deletions learning_route/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def generate(request):

@login_required
def update(request, id: int):
'''
"""
user_id = request.session.get("user_id")
if user_id:
user = get_object_or_404(User, id=user_id)
Expand All @@ -116,4 +116,4 @@ def update(request, id: int):
return render(
request, "learning_route_update.html", {"learning_route": learning_route}
)}
'''
"""
13 changes: 6 additions & 7 deletions testsE2E/tests/learningRoute.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ test.describe('learning route', () => {
await page.getByLabel('Time per Session (Minutes):').fill('600');
await page.getByRole('button', { name: 'Save Preferences' }).click();

await page.getByRole('link', { name: 'Current Skills', exact: true }).click();
await page.getByLabel('Current Skills:').selectOption(['2']);
await page.getByRole('button', { name: 'Update Current Skills' }).click();

await page.getByRole('link', { name: 'Target Skills', exact: true }).click();
await page.getByLabel('Target Skills:').selectOption(['6']);
await page.getByRole('link', { name: 'Target Skills ' }).click();
await page.getByRole('combobox').getByRole('list').click();
await page.getByRole('option', { name: 'Python - 5' }).click();
await page.getByRole('combobox').getByRole('list').click();
await page.getByRole('option', { name: 'C++ - 5' }).click();
await page.getByRole('button', { name: 'Update Target Skills' }).click();

await page.getByRole('button', { name: 'Go to your learning routes' }).click();
await page.getByRole('button', { name: 'Go to your learning route' }).click();
await page.getByRole('button', { name: 'Generate Learning Routes' }).click();
await page.getByRole('link', { name: 'Card Image Python Level' }).click();
const page1Promise = page.waitForEvent('popup');
Expand Down
16 changes: 11 additions & 5 deletions testsE2E/tests/profile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,21 @@ test.describe('profileSetup', () => {
});

test('current skill', async ({ page }) => {
await page.getByRole('link', { name: 'Current Skills', exact: true }).click();
await page.getByLabel('Current Skills:').selectOption(['1', '2', '4', '10', '13', '14', '20']);
await page.getByRole('link', { name: 'Current Skills ' }).click();
await page.getByRole('combobox').getByRole('list').click();
await page.getByRole('option', { name: 'Python - 5' }).click();
await page.getByRole('combobox').getByRole('list').click();
await page.getByRole('option', { name: 'MySQL - 5' }).click();
await page.getByRole('button', { name: 'Update Current Skills' }).click();
});

test('target skill', async ({ page }) => {
await page.getByRole('link', { name: 'Target Skills' }).click();
await page.getByLabel('Target Skills:').selectOption(['6', '7', '10', '15', '18']);
await page.getByRole('link', { name: 'Target Skills ' }).click();
await page.getByRole('combobox').getByRole('list').click();
await page.getByRole('option', { name: 'Python - 5' }).click();
await page.getByRole('combobox').getByRole('list').click();
await page.getByRole('option', { name: 'C++ - 5' }).click();
await page.getByRole('button', { name: 'Update Target Skills' }).click();
});

});
4 changes: 2 additions & 2 deletions user/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Meta:
class ProfileUpdateForm(forms.ModelForm):
class Meta:
model = User
fields = ["name","email","image"]
fields = ["name", "email", "image"]
widgets = {
"name": forms.TextInput(
attrs={"class": "form-control", "placeholder": "Enter your name"}
Expand All @@ -75,7 +75,7 @@ class Meta:
),
"image": forms.FileInput(attrs={"class": "form-control-file"}),
}

def clean_email(self):
email = self.cleaned_data.get("email")
if User.objects.filter(email=email).exclude(id=self.instance.id).exists():
Expand Down
1 change: 1 addition & 0 deletions user/templates/update_current_skills.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ <h1>Update Current Skills</h1>
<div class="row">
<div class="col-md-10 form-group">
{{ form.as_p }}
<p>Only the biggest level of each skill will be selected</p>
</div>
</div>
<button type="submit" class="btn btn-primary form-submit">Update Current Skills</button>
Expand Down
1 change: 1 addition & 0 deletions user/templates/update_target_skills.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ <h1>Update Target Skills</h1>
<div class="row">
<div class="col-md-10 form-group">
{{ form.as_p }}
<p>Only the biggest level of each skill will be selected</p>
</div>
</div>
<button type="submit" class="btn btn-primary form-submit">Update Target Skills</button>
Expand Down
4 changes: 2 additions & 2 deletions user/templates/user.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h2>Learning Preferences <i class="fa fa-pencil"></i></h2>
</div>

<div class="skills">
<h2>Current Skills <i class="fa fa-pencil"></i></h2>
<a href="{% url 'update_current_skills' %}" class="button-link"><h2>Current Skills <i class="fa fa-pencil"></i></h2></a>
<a href="{% url 'update_current_skills' %}">
<button class="skill-button">
<div class="skill-set">
Expand All @@ -72,7 +72,7 @@ <h2>Current Skills <i class="fa fa-pencil"></i></h2>
</div>

<div class="skills">
<h2>Target Skills <i class="fa fa-pencil"></i></h2>
<a href="{% url 'update_target_skills' %}" class="button-link"><h2>Target Skills <i class="fa fa-pencil"></i></h2></a>
<a href="{% url 'update_target_skills' %}">
<button class="skill-button">
<div class="skill-set">
Expand Down

0 comments on commit f4a9cb1

Please sign in to comment.