Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix table structure follow specification (refs SFKUI-6500) #123

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 38 additions & 12 deletions packages/vue/src/components/FCrudDataset/FCrudDataset.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,46 @@ function createWrapper(
{ stubs = [] as string[], props = {} } = {},
): VueWrapper<InstanceType<typeof TestComponent>> {
const templateStart = `
<f-crud-dataset v-model="items" :on-cancel="onCancel" :before-validation="beforeValidation" :before-submit="beforeSubmit" @created="onCreatedEvent" @updated="onUpdatedEvent" @deleted="onDeletedEvent">
<f-crud-dataset
v-model="items"
:on-cancel="onCancel"
:before-validation="beforeValidation"
:before-submit="beforeSubmit"
@created="onCreatedEvent"
@updated="onUpdatedEvent"
@deleted="onDeletedEvent"
>
<template #default>
<div id="cancelMessage"> Modalen har stängts </div>
<div id="cancelMessage">Modalen har stängts</div>
<table>
<tr>
<th> id </th>
<th> name </th>
</tr>
<tr v-for="item in items" :key="item.id">
<td> {{ item.id }} </td>
<td> {{ item.name }} </td>
<td> <f-crud-button id="modifyButton" action="modify" :item="item" label /> </td>
<td> <f-crud-button id="deleteButton" action="delete" :item="item" label /> </td>
</tr>
<thead>
<tr>
<th>id</th>
<th>name</th>
</tr>
</thead>
<tbody>
<tr v-for="item in items" :key="item.id">
<td>{{ item.id }}</td>
<td>{{ item.name }}</td>
<td>
<f-crud-button
id="modifyButton"
action="modify"
:item="item"
label
/>
</td>
<td>
<f-crud-button
id="deleteButton"
action="delete"
:item="item"
label
/>
</td>
</tr>
</tbody>
</table>
</template>
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,52 @@

exports[`snapshot should match snapshot 1`] = `
<div class="crud-dataset">
<div id="cancelMessage"> Modalen har stängts </div>
<div id="cancelMessage">Modalen har stängts</div>
<table>
<tr>
<th> id </th>
<th> name </th>
</tr>
<tr>
<td>1</td>
<td>a</td>
<td><button type="button" class="button button--small button--tertiary" id="modifyButton">
<!--v-if-->
<!--v-if-->Ändra
</button></td>
<td><button type="button" class="button button--small button--tertiary" id="deleteButton">
<!--v-if-->
<!--v-if-->Ta bort
</button></td>
</tr>
<tr>
<td>2</td>
<td>b</td>
<td><button type="button" class="button button--small button--tertiary" id="modifyButton">
<!--v-if-->
<!--v-if-->Ändra
</button></td>
<td><button type="button" class="button button--small button--tertiary" id="deleteButton">
<!--v-if-->
<!--v-if-->Ta bort
</button></td>
</tr>
<tr>
<td>3</td>
<td>c</td>
<td><button type="button" class="button button--small button--tertiary" id="modifyButton">
<!--v-if-->
<!--v-if-->Ändra
</button></td>
<td><button type="button" class="button button--small button--tertiary" id="deleteButton">
<!--v-if-->
<!--v-if-->Ta bort
</button></td>
</tr>
<thead>
<tr>
<th>id</th>
<th>name</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>a</td>
<td><button type="button" class="button button--small button--tertiary" id="modifyButton">
<!--v-if-->
<!--v-if-->Ändra
</button></td>
<td><button type="button" class="button button--small button--tertiary" id="deleteButton">
<!--v-if-->
<!--v-if-->Ta bort
</button></td>
</tr>
<tr>
<td>2</td>
<td>b</td>
<td><button type="button" class="button button--small button--tertiary" id="modifyButton">
<!--v-if-->
<!--v-if-->Ändra
</button></td>
<td><button type="button" class="button button--small button--tertiary" id="deleteButton">
<!--v-if-->
<!--v-if-->Ta bort
</button></td>
</tr>
<tr>
<td>3</td>
<td>c</td>
<td><button type="button" class="button button--small button--tertiary" id="modifyButton">
<!--v-if-->
<!--v-if-->Ändra
</button></td>
<td><button type="button" class="button button--small button--tertiary" id="deleteButton">
<!--v-if-->
<!--v-if-->Ta bort
</button></td>
</tr>
</tbody>
</table>
<div><button type="button" class="button button--tertiary crud-dataset__add-button">
<f-icon-stub name="plus" library="f" class="button__icon"></f-icon-stub>Lägg till ny
Expand Down
Loading