Skip to content

Commit

Permalink
Add cypress ids for privacy basic functionality tests
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinDY committed Jun 29, 2023
1 parent 2021d7d commit f7dbefb
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<b-card
data-test-id="card-connection-settings"
class="shadow-sm"
:title="$t('title')"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

<template>
<b-card
data-test-id="card-primary-database"
class="shadow-sm"
header-bg-variant="white"
footer-bg-variant="white"
Expand All @@ -11,6 +12,7 @@

<b-button
v-if="connection"
data-test-id="button-edit"
size="sm"
variant="link"
:to="{ name: 'system.connection.edit', params: { connectionID: (connection || {}).connectionID } }"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<b-card
data-test-id="card-sens-lvl-info"
class="shadow-sm"
header-bg-variant="white"
footer-bg-variant="white"
Expand All @@ -17,6 +18,7 @@
>
<b-form-input
v-model="sensitivityLevel.meta.name"
data-test-id="input-name"
required
:state="nameState"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
>
<b-button
v-if="canCreate"
data-test-id="button-new-sens-lvl"
variant="primary"
class="mr-2"
:to="{ name: 'system.sensitivityLevel.new' }"
Expand Down
1 change: 1 addition & 0 deletions client/web/compose/src/views/Admin/Modules/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<portal to="topbar-tools">
<b-button-group
v-if="isEdit"
data-test-id="button-all-records"
size="sm"
class="mr-1"
>
Expand Down
9 changes: 9 additions & 0 deletions client/web/privacy/src/components/Common/EditorToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<b-col>
<b-button
v-if="backLink"
data-test-id="button-back"
variant="link"
size="lg"
:to="backLink"
Expand Down Expand Up @@ -50,6 +51,7 @@

<b-button
v-else
:data-test-id="buttonLabelCypressId(deleteLabel)"
:disabled="deleteDisabled || processing"
variant="danger"
size="lg"
Expand All @@ -62,6 +64,7 @@

<b-button
v-if="submitShow"
:data-test-id="buttonLabelCypressId(submitLabel)"
:disabled="submitDisabled || processing"
variant="primary"
size="lg"
Expand Down Expand Up @@ -125,6 +128,12 @@ export default {
default: '',
},
},
methods: {
buttonLabelCypressId (label) {
return `button-${label.toLowerCase().split(' ').join('-')}`
},
},
}
</script>

Expand Down
3 changes: 3 additions & 0 deletions client/web/privacy/src/components/Requests/Editor/Export.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
>
<b-form-checkbox
v-model="payload.profile"
data-test-id="checkbox-profile-information"
class="ml-2 mb-1"
>
{{ $t('data-type.profile-information') }}
</b-form-checkbox>
<b-form-checkbox
v-model="payload.application"
data-test-id="checkbox-application-data"
class="ml-2"
>
{{ $t('data-type.application-data') }}
Expand Down Expand Up @@ -48,6 +50,7 @@
>
<b-form-select
v-model="payload.format"
data-test-id="select-file-format"
:options="formatOptions"
/>
</b-form-group>
Expand Down
3 changes: 3 additions & 0 deletions client/web/privacy/src/components/Requests/Viewer/Export.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
label-class="text-primary"
>
<span
data-test-id="span-data-type"
class="ml-2"
>
{{ dataType }}
Expand All @@ -18,6 +19,7 @@
label-class="text-primary"
>
<span
data-test-id="span-date-range"
class="ml-2"
>
{{ $t(`date-range.${payload.range}`) }}
Expand All @@ -29,6 +31,7 @@
label-class="text-primary"
>
<span
data-test-id="span-file-format"
class="ml-2"
>
{{ $t(`file-format.${payload.format}`) }}
Expand Down
6 changes: 5 additions & 1 deletion client/web/privacy/src/components/Requests/Viewer/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
{{ formattedDate }}
</span>
<b-badge
:data-test-id="`badge-${request.status}`"
:variant="statusVariants[request.status]"
pill
class="px-2 py-1"
Expand All @@ -25,7 +26,10 @@
</b-badge>
</h5>

<b-card-text class="text-primary">
<b-card-text
data-test-id="request-author"
class="text-primary"
>
{{ formattedUsers[request.requestedBy] || 'Unknown user' }}
</b-card-text>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
:back-link="{ name: 'data-overview' }"
>
<b-button
data-test-id="button-request-deletion"
:disabled="processing.connections || processing.sensitiveData"
variant="light"
size="lg"
Expand All @@ -73,6 +74,7 @@
</b-button>

<b-button
data-test-id="button-request-correction"
:disabled="processing.connections || processing.sensitiveData"
variant="primary"
size="lg"
Expand Down
1 change: 1 addition & 0 deletions lib/vue/src/components/privacy/CSensitivityLevelPicker.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<vue-select
data-test-id="select-sens-lvl"
key="type"
:value="_value"
:disabled="_disabled"
Expand Down

0 comments on commit f7dbefb

Please sign in to comment.