Skip to content

Commit e6efd26

Browse files
AntonyRafaelgustavosbarreto
authored andcommitted
ui: fix welcome third screen to show the first device added
1 parent b258ee9 commit e6efd26

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

ui/src/components/Welcome/WelcomeThirdScreen.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<v-card class="pa-2" tile :elevation="0">
1515
<strong>Hostname</strong>
1616
</v-card>
17+
<v-divider />
1718
<v-card
1819
class="pa-2"
1920
tile
@@ -27,6 +28,7 @@
2728
<v-card class="pa-2" tile :elevation="0">
2829
<strong>Operation System</strong>
2930
</v-card>
31+
<v-divider />
3032
<v-card
3133
class="pa-2"
3234
tile

ui/src/store/modules/devices.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ export const devices: Module<DevicesState, State> = {
232232
const res = await apiDevice.fetchDevices(
233233
1,
234234
1,
235-
null,
235+
undefined,
236236
"pending",
237-
null,
237+
undefined,
238238
"",
239239
);
240240
context.commit("setDevice", res.data[0]);

ui/tests/components/Welcome/WelcomeThirdScreen.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { createVuetify } from "vuetify";
2-
import { flushPromises, mount, VueWrapper } from "@vue/test-utils";
2+
import { mount, VueWrapper } from "@vue/test-utils";
33
import { beforeEach, describe, expect, it, vi } from "vitest";
4-
import WelcomeThirdScreen from "../../../src/components/Welcome/WelcomeThirdScreen.vue";
54
import { createStore } from "vuex";
5+
import WelcomeThirdScreen from "../../../src/components/Welcome/WelcomeThirdScreen.vue";
66
import { key } from "../../../src/store";
77
import routes from "../../../src/router";
88

@@ -66,14 +66,14 @@ describe("WelcomeThirdScreen", () => {
6666
it("Data is defined", () => {
6767
expect(wrapper.vm.$data).toBeDefined();
6868
});
69-
it('Process data in the computed', () => {
69+
it("Process data in the computed", () => {
7070
expect(wrapper.vm.getPendingDevice).toEqual(device);
7171
});
72-
//////
72+
//////
7373
// HTML validation
7474
//////
7575

76-
it('Renders the template with data', () => {
76+
it("Renders the template with data", () => {
7777
expect(wrapper.find('[data-test="deviceName-field"]').text()).toEqual(device.name);
7878
expect(wrapper.find('[data-test="devicePrettyName-field"]').text()).toEqual(device.info.pretty_name);
7979
});

ui/tests/components/Welcome/__snapshots__/WelcomeThirdScreen.spec.ts.snap

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ exports[`WelcomeThirdScreen > Renders the component 1`] = `
99
<div class=\\"v-card v-theme--light v-card--density-default elevation-0 v-card--variant-elevated pa-2\\" tile=\\"\\">
1010
<!---->
1111
<div class=\\"v-card__loader\\">
12-
<div class=\\"v-progress-linear v-theme--light\\" style=\\"height: 0px; --v-progress-linear-height: 2px;\\" role=\\"progressbar\\" aria-valuemin=\\"0\\" aria-valuemax=\\"100\\">
12+
<div class=\\"v-progress-linear v-theme--light\\" style=\\"top: 0px; height: 0px; --v-progress-linear-height: 2px; left: 50%; transform: translateX(-50%);\\" role=\\"progressbar\\" aria-hidden=\\"true\\" aria-valuemin=\\"0\\" aria-valuemax=\\"100\\">
1313
<!---->
1414
<div class=\\"v-progress-linear__background\\" style=\\"width: 100%;\\"></div>
1515
<transition-stub name=\\"fade-transition\\" appear=\\"false\\" persisted=\\"false\\" css=\\"true\\">
@@ -26,10 +26,11 @@ exports[`WelcomeThirdScreen > Renders the component 1`] = `
2626
<!---->
2727
<!----><span class=\\"v-card__underlay\\"></span>
2828
</div>
29+
<hr class=\\"v-divider v-theme--light\\" aria-orientation=\\"horizontal\\" role=\\"separator\\">
2930
<div class=\\"v-card v-theme--light v-card--density-default elevation-0 v-card--variant-elevated pa-2\\" tile=\\"\\" data-test=\\"deviceName-field\\">
3031
<!---->
3132
<div class=\\"v-card__loader\\">
32-
<div class=\\"v-progress-linear v-theme--light\\" style=\\"height: 0px; --v-progress-linear-height: 2px;\\" role=\\"progressbar\\" aria-valuemin=\\"0\\" aria-valuemax=\\"100\\">
33+
<div class=\\"v-progress-linear v-theme--light\\" style=\\"top: 0px; height: 0px; --v-progress-linear-height: 2px; left: 50%; transform: translateX(-50%);\\" role=\\"progressbar\\" aria-hidden=\\"true\\" aria-valuemin=\\"0\\" aria-valuemax=\\"100\\">
3334
<!---->
3435
<div class=\\"v-progress-linear__background\\" style=\\"width: 100%;\\"></div>
3536
<transition-stub name=\\"fade-transition\\" appear=\\"false\\" persisted=\\"false\\" css=\\"true\\">
@@ -51,7 +52,7 @@ exports[`WelcomeThirdScreen > Renders the component 1`] = `
5152
<div class=\\"v-card v-theme--light v-card--density-default elevation-0 v-card--variant-elevated pa-2\\" tile=\\"\\">
5253
<!---->
5354
<div class=\\"v-card__loader\\">
54-
<div class=\\"v-progress-linear v-theme--light\\" style=\\"height: 0px; --v-progress-linear-height: 2px;\\" role=\\"progressbar\\" aria-valuemin=\\"0\\" aria-valuemax=\\"100\\">
55+
<div class=\\"v-progress-linear v-theme--light\\" style=\\"top: 0px; height: 0px; --v-progress-linear-height: 2px; left: 50%; transform: translateX(-50%);\\" role=\\"progressbar\\" aria-hidden=\\"true\\" aria-valuemin=\\"0\\" aria-valuemax=\\"100\\">
5556
<!---->
5657
<div class=\\"v-progress-linear__background\\" style=\\"width: 100%;\\"></div>
5758
<transition-stub name=\\"fade-transition\\" appear=\\"false\\" persisted=\\"false\\" css=\\"true\\">
@@ -68,10 +69,11 @@ exports[`WelcomeThirdScreen > Renders the component 1`] = `
6869
<!---->
6970
<!----><span class=\\"v-card__underlay\\"></span>
7071
</div>
72+
<hr class=\\"v-divider v-theme--light\\" aria-orientation=\\"horizontal\\" role=\\"separator\\">
7173
<div class=\\"v-card v-theme--light v-card--density-default elevation-0 v-card--variant-elevated pa-2\\" tile=\\"\\" data-test=\\"devicePrettyName-field\\">
7274
<!---->
7375
<div class=\\"v-card__loader\\">
74-
<div class=\\"v-progress-linear v-theme--light\\" style=\\"height: 0px; --v-progress-linear-height: 2px;\\" role=\\"progressbar\\" aria-valuemin=\\"0\\" aria-valuemax=\\"100\\">
76+
<div class=\\"v-progress-linear v-theme--light\\" style=\\"top: 0px; height: 0px; --v-progress-linear-height: 2px; left: 50%; transform: translateX(-50%);\\" role=\\"progressbar\\" aria-hidden=\\"true\\" aria-valuemin=\\"0\\" aria-valuemax=\\"100\\">
7577
<!---->
7678
<div class=\\"v-progress-linear__background\\" style=\\"width: 100%;\\"></div>
7779
<transition-stub name=\\"fade-transition\\" appear=\\"false\\" persisted=\\"false\\" css=\\"true\\">
@@ -85,7 +87,7 @@ exports[`WelcomeThirdScreen > Renders the component 1`] = `
8587
</div>
8688
<!---->
8789
<!---->
88-
<div><i data-test=\\"type-icon\\" class=\\"fl-archlinux\\" style=\\"font-size: 20px;\\"></i> Linux</div>
90+
<div><i data-test=\\"type-icon\\" class=\\"fl-archlinux mr-1\\" style=\\"font-size: 18px;\\"></i> Linux</div>
8991
<!---->
9092
<!----><span class=\\"v-card__underlay\\"></span>
9193
</div>

0 commit comments

Comments
 (0)