Skip to content

Commit

Permalink
コード整形とデザイン変更に伴ったテスト修正
Browse files Browse the repository at this point in the history
  • Loading branch information
a-terumoto-gs committed Mar 25, 2024
1 parent 22b304c commit 5ccdcca
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
7 changes: 4 additions & 3 deletions app/javascript/generation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
| {{ generation.number }}期生
.user-group__date
| {{ dateFormat(generation.start_date) }} ~ {{ dateFormat(generation.end_date) }}
.user-group__counts.is-only-mentor(v-if="isAdminOrMentor() && target === 'all'")
.user-group__counts.is-only-mentor(
v-if='isAdminOrMentor() && target === "all"')
.card-counts
.card-counts__items
.card-counts__item
Expand Down Expand Up @@ -108,8 +109,8 @@ export default {
},
isAdminOrMentor() {
return (
this.currentUser.roles.includes("admin") ||
this.currentUser.roles.includes("mentor")
this.currentUser.roles.includes('admin') ||
this.currentUser.roles.includes('mentor')
)
}
}
Expand Down
4 changes: 3 additions & 1 deletion app/javascript/generations.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ document.addEventListener('DOMContentLoaded', () => {
const generations = document.querySelector(selector)
if (generations) {
const target = generations.getAttribute('data-target')
const currentUserId = generations.getAttribute('data-current-user-id:number')
const currentUserId = generations.getAttribute(
'data-current-user-id:number'
)
new Vue({
render: (h) =>
h(Generations, {
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/generations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
:key='generation.number',
:generation='generation',
:target='target',
:currentUser = 'currentUser')
:currentUser='currentUser')
nav.pagination(v-if='totalPages > 1')
pager(v-bind='pagerProps')
</template>
Expand Down
7 changes: 6 additions & 1 deletion test/system/generations_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,12 @@ class GenerationsTest < ApplicationSystemTestCase
assert_text '期生別(全員)'
assert_link '5期生'
assert_text '2014年01月01日 ~ 2014年03月31日'
assert_text '現役生 14人 卒業生 2人 退会者 2人'
assert_selector '.card-counts__item-label', text: '現役生'
assert_selector '.card-counts__item-value', text: 14
assert_selector '.card-counts__item-label', text: '卒業生'
assert_selector '.card-counts__item-value', text: 2
assert_selector '.card-counts__item-label', text: '退会者'
assert_selector '.card-counts__item-value', text: 2
end
end
end

0 comments on commit 5ccdcca

Please sign in to comment.