FIX - linting errors for the build
| | |
| | | { |
| | | "root": true, |
| | | "extends": [ |
| | | "plugin:vue/essential", |
| | | "@vue/prettier" |
| | | ], |
| | | "extends": ["plugin:vue/essential", "@vue/prettier"], |
| | | "env": { |
| | | "es6": true, |
| | | "node": true |
| | | }, |
| | | "ecmaFeatures": { |
| | | "modules": true |
| | | } |
| | | }, |
| | | "rules": { "no-unused-vars": 0 } |
| | | } |
| | |
| | | module.exports = { |
| | | moduleFileExtensions: [ |
| | | "js", |
| | | "jsx", |
| | | "json", |
| | | "vue" |
| | | ], |
| | | moduleFileExtensions: ["js", "jsx", "json", "vue"], |
| | | transform: { |
| | | "^.+\\.vue$": "vue-jest", |
| | | "^.+\\.jsx?$": "babel-jest" |
| | |
| | | "!src/**/*.test.{js,jsx}", |
| | | "!<rootDir>/node_modules/" |
| | | ], |
| | | testResultsProcessor: './node_modules/jest-junit-reporter', |
| | | coverageDirectory: './reports/coverage', |
| | | coverageReporters: [ |
| | | "text", |
| | | "html", |
| | | "clover" |
| | | ] |
| | | } |
| | | testResultsProcessor: "./node_modules/jest-junit-reporter", |
| | | coverageDirectory: "./reports/coverage", |
| | | coverageReporters: ["text", "html", "clover"] |
| | | }; |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | |
| | | function padLeft (count) { // theregister.co.uk/2016/03/23/npm_left_pad_chaos/ |
| | | function padLeft(count) { |
| | | // theregister.co.uk/2016/03/23/npm_left_pad_chaos/ |
| | | return count < 10 ? "0" + count: count.toString(); |
| | | } |
| | | |
| | |
| | | meta.push(a.browserName ? a.browserName: "any"); |
| | | meta.push(a.version ? a.version: "any"); |
| | | meta.push(a.name); // this is the test filename so always exists. |
| | | var metadata = meta.join("~").toLowerCase().replace(/ /g, ""); |
| | | var metadata = meta |
| | | .join("~") |
| | | .toLowerCase() |
| | | .replace(/ /g, ""); |
| | | return SCREENSHOT_PATH + metadata + "_" + padLeft(FILECOUNT++) + "_"; |
| | | } |
| | | |
| | |
| | | </template> |
| | | |
| | | <style lang="scss"> |
| | | |
| | | @import "scss/custom.scss"; |
| | | |
| | | #app { |
| | |
| | | }, |
| | | { |
| | | name: "Inside a Residency Blog", |
| | | url: "https://developers.redhat.com/blog/2018/01/26/part-1-inside-open-innovation-labs-residency/" |
| | | url: |
| | | "https://developers.redhat.com/blog/2018/01/26/part-1-inside-open-innovation-labs-residency/" |
| | | } |
| | | ], |
| | | social: [ |
| | | { |
| | | name: "YouTube", |
| | | url: |
| | | "https://www.youtube.com/watch?v=RxOKoqpDuIA" |
| | | url: "https://www.youtube.com/watch?v=RxOKoqpDuIA" |
| | | }, |
| | | { |
| | | name: "Twitter", |
| | | url: |
| | | "https://twitter.com/redhatlabs?lang=en" |
| | | url: "https://twitter.com/redhatlabs?lang=en" |
| | | } |
| | | ] |
| | | }; |
| | |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style scoped lang="scss"> |
| | | |
| | | </style> |
| | |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style scoped lang="scss"> |
| | | |
| | | </style> |
| | |
| | | export default { |
| | | todoEndpoint: "http://todolist-api-<YOUR_NAME>-dev.apps.somedomain.com/api/todos" |
| | | todoEndpoint: |
| | | "http://todolist-api-<YOUR_NAME>-dev.apps.somedomain.com/api/todos" |
| | | }; |
| | |
| | | export default { |
| | | todoEndpoint: "http://todolist-api-<YOUR_NAME>-test.apps.somedomain.com/api/todos" |
| | | todoEndpoint: |
| | | "http://todolist-api-<YOUR_NAME>-test.apps.somedomain.com/api/todos" |
| | | }; |
| | |
| | | MARK_TODO_COMPLETED(state, index) { |
| | | console.log("INFO - MARK_TODO_COMPLETED"); |
| | | state.todos[index].completed = !state.todos[index].completed; |
| | | }, |
| | | } |
| | | }; |
| | |
| | | export default { |
| | | name: "ComponentView", |
| | | data() { |
| | | return { |
| | | |
| | | } |
| | | return {}; |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | padding-top: 20px; |
| | | } |
| | | </style> |
| | | |
| | |
| | | import NewTodo from "@/components/NewTodo.vue"; |
| | | import ListOfTodos from "@/components/ListOfTodos.vue"; |
| | | import XofYItems from "@/components/XofYItems.vue"; |
| | | import { mapMutations } from 'vuex' |
| | | import { mapMutations } from "vuex"; |
| | | |
| | | export default { |
| | | name: "Todo", |
| | |
| | | XofYItems |
| | | }, |
| | | methods: { |
| | | ...mapMutations([ |
| | | 'editTodo', |
| | | 'toggleTodo', |
| | | 'deleteTodo' |
| | | ]), |
| | | }, |
| | | ...mapMutations(["editTodo", "toggleTodo", "deleteTodo"]) |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | |
| | | it("should call MARK_TODO_IMPORTANT", done => { |
| | | const commit = sinon.spy(); |
| | | state.todos = todos; |
| | | actions.updateTodo({ commit, state }, { id: 1 , important: true }).then(() => { |
| | | actions |
| | | .updateTodo({ commit, state }, { id: 1, important: true }) |
| | | .then(() => { |
| | | // TODO - test goes here! |
| | | |
| | | done(); |
| | |
| | | it("it should MARK_TODO_IMPORTANT as false", () => { |
| | | state.todos = importantTodos; |
| | | // TODO - test goes here! |
| | | |
| | | }); |
| | | |
| | | it("it should MARK_TODO_IMPORTANT as true", () => { |
| | | state.todos = importantTodos; |
| | | // TODO - test goes here! |
| | | |
| | | }); |
| | | }); |
| | |
| | | import Vue from 'vue' |
| | | import Vue from "vue"; |
| | | |
| | | Vue.config.productionTip = false |
| | | Vue.config.productionTip = false; |
| | | import VueMaterial from "vue-material"; |
| | | // import "vue-material/dist/vue-material.min.css"; |
| | | Vue.use(VueMaterial); |
| | |
| | | import * as all from "../setup.js"; |
| | | |
| | | describe("Header.vue", () => { |
| | | |
| | | // const Date = 15 / 12 / 1995; |
| | | // it("has the expected html structure", () => { |
| | | // const created = () => {} |
| | |
| | | ]; |
| | | const actions = { |
| | | loadTodos: jest.fn() |
| | | } |
| | | }; |
| | | const getters = { |
| | | todos: jest.fn() |
| | | } |
| | | }; |
| | | beforeEach(() => { |
| | | |
| | | store = new Vuex.Store({ |
| | | state: {}, |
| | | propsData: { todos }, |
| | | actions, getters |
| | | actions, |
| | | getters |
| | | }); |
| | | }); |
| | | |
| | | it("calls the loadTodos function from actionsjs when created", () => { |
| | | const wrapper = shallow(ListOfTodos, { store, localVue }); |
| | | expect(actions.loadTodos).toHaveBeenCalled(); |
| | | }) |
| | | }); |
| | | |
| | | it("maps getters with todos when computed", () => { |
| | | const wrapper = shallow(ListOfTodos, { store, localVue }); |
| | | expect(getters.todos).toHaveBeenCalled(); |
| | | }) |
| | | }); |
| | | |
| | | it("has the expected html structure", () => { |
| | | const wrapper = shallow(ListOfTodos, { store, localVue }); |
| | |
| | | import { shallow, createLocalVue, mount } from "@vue/test-utils"; |
| | | import Vuex from 'vuex'; |
| | | import Vuex from "vuex"; |
| | | import NewTodo from "@/components/NewTodo.vue"; |
| | | // import { expect } from 'chai' |
| | | |
| | | import * as all from "../setup.js"; |
| | | |
| | | const localVue = createLocalVue() |
| | | const localVue = createLocalVue(); |
| | | |
| | | localVue.use(Vuex) |
| | | localVue.use(Vuex); |
| | | |
| | | describe("NewTodo.vue", () => { |
| | | let methods; |
| | | let store; |
| | | |
| | | beforeEach(() => { |
| | | methods = { |
| | | (methods = { |
| | | newTodoAdded: jest.fn() |
| | | }, |
| | | store = new Vuex.Store({ |
| | | }), |
| | | (store = new Vuex.Store({ |
| | | state: {}, |
| | | methods |
| | | }) |
| | | })); |
| | | }); |
| | | |
| | | it("calls newTodoAdded() when keyup.enter hit.", () => { |
| | | // time to try and test some vuex stuff and see if the methods are called when expected. |
| | | const wrapper = shallow(NewTodo, { methods , localVue}) |
| | | const wrapper = shallow(NewTodo, { methods, localVue }); |
| | | const input = wrapper.find(".md-input"); |
| | | input.trigger('keyup.enter') |
| | | expect(methods.newTodoAdded).toHaveBeenCalled() |
| | | input.trigger("keyup.enter"); |
| | | expect(methods.newTodoAdded).toHaveBeenCalled(); |
| | | }); |
| | | |
| | | it("does not call newTodoAdded() when keyup.space hit.", () => { |
| | | // time to try and test some vuex stuff and see if the methods are called when expected. |
| | | const wrapper = shallow(NewTodo, { methods , localVue}) |
| | | const wrapper = shallow(NewTodo, { methods, localVue }); |
| | | const input = wrapper.find(".md-input"); |
| | | input.trigger('keyup.space') |
| | | expect(methods.newTodoAdded).not.toHaveBeenCalled() |
| | | input.trigger("keyup.space"); |
| | | expect(methods.newTodoAdded).not.toHaveBeenCalled(); |
| | | }); |
| | | |
| | | it("renders props.placeholderMsg when passed", () => { |
| | |
| | | expect(wrapper.find(XofYItems)).toBeTruthy(); |
| | | }); |
| | | // NEW TEST GOES HERE |
| | | |
| | | }); |
| | |
| | | } |
| | | ]; |
| | | |
| | | expect(mockedTodos.length).toEqual(3) |
| | | expect(mockedTodos.length).toEqual(3); |
| | | // Replace with testing the sumDoneTodoItems function and check it it's called |
| | | // expect(sumDoneTodoItems).toHaveBeenCalled() |
| | | }); |