/Convenia-Senior-Frontend-Assessment

Teste para pessoa desenvolvedora frontend Vue JS - Senior

Primary LanguageTypeScript

Welcome to Barcontrol 🍺

Version Node version Social

Barcontrol

Project for a restaurant or bar to do the command control. Each item and order with their respective values are stored in memories to perform the necessary calculations and close the account.

🚀 Start

These instructions will allow you to get a copy of the project running on your local machine for development and testing purposes..

📋 Pre-requisites

Need to have installed node

^16.17 - node

🔧 Installation

It is recommended to use yarn to install packages, but you can use npm

yarn install

or

npm install

⚠️ CAUTION ⚠️

For a more secure execution of the system, it is important to raise the GraphQL currency conversion API on port 3000. But has configuration mock server with mirage API, that's why sisytem won't break

⚙️ Running the tests

For the automated unit tests run

yarn test:unit

or

npm run test:unit

🔩 Analyze the unit tests

Unit tests check the consistency of base components of the system (UI components). They also test useful functions that are shared at various points in the application

import { describe, it, expect } from "vitest";

import { mount } from "@vue/test-utils";
import AccordionUI from "../components-ui/AccordionUI.vue";

describe("AccordionUI", () => {
  it("Should renders properly for title", () => {
    const wrapper = mount(AccordionUI, { props: { title: "Bebidas" } });
    expect(wrapper.text()).toContain("Bebidas");
  });

  it("Should renders properly for title", () => {
    const wrapper = mount(AccordionUI, { props: { isOpen: true } });
    expect(wrapper.find("#summary-details").exists()).toBe(true);
  });

  it("Should renders slot List", () => {
    const wrapper = mount(AccordionUI, {
      props: {
        isOpen: true,
      },
      slots: {
        list: "<div>List</div>",
      },
    });
    expect(wrapper.html()).toContain("<div>List</div>");
  });
});
import { describe, it, expect } from "vitest";
import { getFormattedHour, getFormattedDateWithHour } from "../formatDate";

describe("Format Date", () => {
  it("Should formatted Hour", () => {
    expect(getFormattedHour(new Date("2023-01-24T01:12:19.836Z"))).equals(
      "21:12",
    );
  });

  it("Should formatted Date with hour", () => {
    expect(
      getFormattedDateWithHour(new Date("2023-01-24T01:12:19.836Z")),
    ).equals("23/01/2023 21:12");
  });
});

📚 Running Storybook

Storybooks are for recording the behavior of UI components. Important documentation for compressing components.

For the storybook run

yarn storybook

or

npm run storybook

📦 Project run

Project will run on port http://locahost:8080. To run the project locally

yarn dev

or

npm run dev

🛠️ Technologies

📌 Versions

Used in the Semantic Versioning project and Conventional Commits

✒️ Authors