Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
boco-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
idatt2106_2022_02
boco-frontend
Commits
da993300
Commit
da993300
authored
3 years ago
by
Oda Alida Fønstelien Hjelljord
Browse files
Options
Downloads
Plain Diff
Merge branch 'new_item_fix' into 'main'
new item fix See merge request
!79
parents
c6258192
c3087ca4
No related branches found
No related tags found
1 merge request
!79
new item fix
Pipeline
#179518
passed
3 years ago
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/ItemComponents/NewItemForm.vue
+13
-35
13 additions, 35 deletions
src/components/ItemComponents/NewItemForm.vue
tests/unit/component-tests/community-component-tests/add-new-item.spec.js
+0
-5
0 additions, 5 deletions
...nent-tests/community-component-tests/add-new-item.spec.js
with
13 additions
and
40 deletions
src/components/ItemComponents/NewItemForm.vue
+
13
−
35
View file @
da993300
...
@@ -66,6 +66,7 @@
...
@@ -66,6 +66,7 @@
</div>
</div>
</div>
</div>
<!-- Grupper -->
<div
class=
"mb-6"
>
<div
class=
"mb-6"
>
<label
<label
class=
"block text-sm font-medium text-gray-900 dark:text-gray-400"
class=
"block text-sm font-medium text-gray-900 dark:text-gray-400"
...
@@ -93,29 +94,6 @@
...
@@ -93,29 +94,6 @@
<label
class=
"text-error text-sm block"
>
{{
groupErrorMessage
}}
</label>
<label
class=
"text-error text-sm block"
>
{{
groupErrorMessage
}}
</label>
</div>
</div>
<!-- error message for select box -->
<div
class=
"overflow-auto w-full h-32 mt-2 text-base list-none bg-white rounded divide-y divide-gray-100 dark:bg-gray-700"
>
<ul
class=
"py-1"
aria-labelledby=
"dropdownDefault"
>
<li>
<div
class=
"form-check"
v-for=
"group in groups"
:key=
"group"
>
<input
class=
"form-check-input appearance-none h-4 w-4 border border-gray-300 rounded-sm bg-white checked:bg-primary-medium checked:bg-primary-medium focus:outline-none transition duration-200 mt-1 align-top bg-no-repeat bg-center bg-contain float-left mr-2 cursor-pointer"
type=
"checkbox"
:value=
"group.communityId"
@
change=
"onChangeGroup($event)"
>
<label
class=
"form-check-label inline-block text-gray-800"
>
{{
group
.
name
}}
</label>
</div>
</li>
</ul>
</div>
<label
class=
"text-error text-sm block"
>
{{
groupErrorMessage
}}
</label>
<!-- price -->
<!-- price -->
<div
class=
"mb-6 mt-4"
:class=
"
{ error: v$.item.price.$errors.length }">
<div
class=
"mb-6 mt-4"
:class=
"
{ error: v$.item.price.$errors.length }">
<label
<label
...
...
This diff is collapsed.
Click to expand it.
tests/unit/component-tests/community-component-tests/add-new-item.spec.js
+
0
−
5
View file @
da993300
...
@@ -6,7 +6,6 @@ describe("addNewItem elements rendering", () => {
...
@@ -6,7 +6,6 @@ describe("addNewItem elements rendering", () => {
const
wrapper
=
shallowMount
(
AddNewItem
);
const
wrapper
=
shallowMount
(
AddNewItem
);
expect
(
wrapper
.
find
(
"
#titleLabel
"
).
text
()).
toMatch
(
"
Tittel
"
);
expect
(
wrapper
.
find
(
"
#titleLabel
"
).
text
()).
toMatch
(
"
Tittel
"
);
expect
(
wrapper
.
find
(
"
#selectCategoryLabel
"
).
text
()).
toMatch
(
"
Kategori
"
);
expect
(
wrapper
.
find
(
"
#priceLabel
"
).
text
()).
toMatch
(
"
Pris
"
);
expect
(
wrapper
.
find
(
"
#priceLabel
"
).
text
()).
toMatch
(
"
Pris
"
);
expect
(
wrapper
.
find
(
"
#descriptionLabel
"
).
text
()).
toMatch
(
"
Beskrivelse
"
);
expect
(
wrapper
.
find
(
"
#descriptionLabel
"
).
text
()).
toMatch
(
"
Beskrivelse
"
);
expect
(
wrapper
.
find
(
"
#imageLabel
"
).
text
()).
toMatch
(
"
Bilde
"
);
expect
(
wrapper
.
find
(
"
#imageLabel
"
).
text
()).
toMatch
(
"
Bilde
"
);
...
@@ -19,10 +18,6 @@ describe("addNewItem elements rendering", () => {
...
@@ -19,10 +18,6 @@ describe("addNewItem elements rendering", () => {
await
titleInput
.
setValue
(
"
Dyson
"
);
await
titleInput
.
setValue
(
"
Dyson
"
);
expect
(
titleInput
.
element
.
value
).
toBe
(
"
Dyson
"
);
expect
(
titleInput
.
element
.
value
).
toBe
(
"
Dyson
"
);
const
selectedCategory
=
wrapper
.
find
(
"
#categories
"
);
await
selectedCategory
.
setValue
(
"
Hage
"
);
expect
(
selectedCategory
.
element
.
value
).
toBe
(
"
Hage
"
);
const
priceInput
=
wrapper
.
find
(
"
#price
"
);
const
priceInput
=
wrapper
.
find
(
"
#price
"
);
await
priceInput
.
setValue
(
500
);
await
priceInput
.
setValue
(
500
);
expect
(
priceInput
.
element
.
value
).
toBe
(
"
500
"
);
expect
(
priceInput
.
element
.
value
).
toBe
(
"
500
"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment