diff --git a/.prettierrc.js b/.prettierrc.js index 4f012c6d9..f2c6fc849 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,16 +1,18 @@ -exports.default = { +const config = { printWidth: 120, useTabs: false, tabWidth: 2, - trailingComma: 'es5', + trailingComma: "none", semi: true, singleQuote: false, bracketSpacing: true, - arrowParens: 'always', + arrowParens: "always", jsxSingleQuote: false, bracketSameLine: false, - endOfLine: 'lf', - importOrder: ['^@core/(.*)$', '^@server/(.*)$', '^@ui/(.*)$', '^[./]'], + endOfLine: "lf", + importOrder: ["^@core/(.*)$", "^@server/(.*)$", "^@ui/(.*)$", "^[./]"], importOrderSeparation: true, - importOrderSortSpecifiers: true, + importOrderSortSpecifiers: true }; + +module.exports = config; diff --git a/_reference/Test_CDK_Acct Config.json b/_reference/Test_CDK_Acct Config.json index 44a140906..d8e7da4fc 100644 --- a/_reference/Test_CDK_Acct Config.json +++ b/_reference/Test_CDK_Acct Config.json @@ -567,4 +567,4 @@ "description": "Exempt" } ] -} \ No newline at end of file +} diff --git a/_reference/test-ecoystem.config.js b/_reference/test-ecoystem.config.js index 37bae797c..1bf66e16c 100644 --- a/_reference/test-ecoystem.config.js +++ b/_reference/test-ecoystem.config.js @@ -1,20 +1,20 @@ module.exports = { - apps: [ - { - name: "IO Test API", - cwd: "./io", - script: "./server.js", - env: { - NODE_ENV: "test", - }, - }, + apps: [ + { + name: "IO Test API", + cwd: "./io", + script: "./server.js", + env: { + NODE_ENV: "test" + } + }, - { - name: "Bitbucket Webhook", - script: "./webhook/index.js", - env: { - NODE_ENV: "production", - }, - }, - ], + { + name: "Bitbucket Webhook", + script: "./webhook/index.js", + env: { + NODE_ENV: "production" + } + } + ] }; diff --git a/client/craco.config.js b/client/craco.config.js index 54f46cdb6..87abf5bcf 100644 --- a/client/craco.config.js +++ b/client/craco.config.js @@ -1,10 +1,10 @@ // craco.config.js const TerserPlugin = require("terser-webpack-plugin"); const CracoLessPlugin = require("craco-less"); -const {convertLegacyToken} = require('@ant-design/compatible/lib'); -const {theme} = require('antd/lib'); +const { convertLegacyToken } = require("@ant-design/compatible/lib"); +const { theme } = require("antd/lib"); -const {defaultAlgorithm, defaultSeed} = theme; +const { defaultAlgorithm, defaultSeed } = theme; const mapToken = defaultAlgorithm(defaultSeed); const v4Token = convertLegacyToken(mapToken); @@ -12,43 +12,42 @@ const v4Token = convertLegacyToken(mapToken); // TODO, At the moment we are using less in the Dashboard. Once we remove this we can remove the less processor entirely. module.exports = { - plugins: [ - - { - plugin: CracoLessPlugin, - options: { - lessLoaderOptions: { - lessOptions: { - modifyVars: {...v4Token}, - javascriptEnabled: true, - }, - }, - }, + plugins: [ + { + plugin: CracoLessPlugin, + options: { + lessLoaderOptions: { + lessOptions: { + modifyVars: { ...v4Token }, + javascriptEnabled: true + } + } + } + } + ], + webpack: { + configure: (webpackConfig) => { + return { + ...webpackConfig, + // Required for Dev Server + devServer: { + ...webpackConfig.devServer, + allowedHosts: "all" }, - ], - webpack: { - configure: (webpackConfig) => { - return { - ...webpackConfig, - // Required for Dev Server - devServer: { - ...webpackConfig.devServer, - allowedHosts: 'all', - }, - optimization: { - ...webpackConfig.optimization, - // Workaround for CircleCI bug caused by the number of CPUs shown - // https://github.com/facebook/create-react-app/issues/8320 - minimizer: webpackConfig.optimization.minimizer.map((item) => { - if (item instanceof TerserPlugin) { - item.options.parallel = 2; - } + optimization: { + ...webpackConfig.optimization, + // Workaround for CircleCI bug caused by the number of CPUs shown + // https://github.com/facebook/create-react-app/issues/8320 + minimizer: webpackConfig.optimization.minimizer.map((item) => { + if (item instanceof TerserPlugin) { + item.options.parallel = 2; + } - return item; - }), - }, - }; - }, - }, - devtool: "source-map", + return item; + }) + } + }; + } + }, + devtool: "source-map" }; diff --git a/client/cypress.config.js b/client/cypress.config.js index f227b0b40..1f2d28ce6 100644 --- a/client/cypress.config.js +++ b/client/cypress.config.js @@ -1,17 +1,17 @@ -const {defineConfig} = require('cypress') +const { defineConfig } = require("cypress"); module.exports = defineConfig({ - experimentalStudio: true, - env: { - FIREBASE_USERNAME: 'cypress@imex.test', - FIREBASE_PASSWORD: 'cypress', + experimentalStudio: true, + env: { + FIREBASE_USERNAME: "cypress@imex.test", + FIREBASE_PASSWORD: "cypress" + }, + e2e: { + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. + setupNodeEvents(on, config) { + return require("./cypress/plugins/index.js")(on, config); }, - e2e: { - // We've imported your old cypress plugins here. - // You may want to clean this up later by importing these. - setupNodeEvents(on, config) { - return require('./cypress/plugins/index.js')(on, config) - }, - baseUrl: 'http://localhost:3000', - }, -}) + baseUrl: "http://localhost:3000" + } +}); diff --git a/client/cypress/e2e/01-General Render/01-home.cy.js b/client/cypress/e2e/01-General Render/01-home.cy.js index 120baa84f..44202154f 100644 --- a/client/cypress/e2e/01-General Render/01-home.cy.js +++ b/client/cypress/e2e/01-General Render/01-home.cy.js @@ -1,24 +1,19 @@ /// -const {FIREBASE_USERNAME, FIREBASE_PASSWORcD} = Cypress.env(); +const { FIREBASE_USERNAME, FIREBASE_PASSWORcD } = Cypress.env(); describe("Renders the General Page", () => { - beforeEach(() => { - cy.visit("/"); - }); - it("Renders Correctly", () => { - }); - it("Has the Slogan", () => { - cy.findByText("A whole x22new kind of shop management system.").should( - "exist" - ); - /* ==== Generated with Cypress Studio ==== */ - cy.get( - ".ant-menu-item-active > .ant-menu-title-content > .header0-item-block" - ).click(); - cy.get("#email").clear(); - cy.get("#email").type("patrick@imex.dev"); - cy.get("#password").clear(); - cy.get("#password").type("patrick123{enter}"); - cy.get(".ant-form > .ant-btn").click(); - /* ==== End Cypress Studio ==== */ - }); + beforeEach(() => { + cy.visit("/"); + }); + it("Renders Correctly", () => {}); + it("Has the Slogan", () => { + cy.findByText("A whole x22new kind of shop management system.").should("exist"); + /* ==== Generated with Cypress Studio ==== */ + cy.get(".ant-menu-item-active > .ant-menu-title-content > .header0-item-block").click(); + cy.get("#email").clear(); + cy.get("#email").type("patrick@imex.dev"); + cy.get("#password").clear(); + cy.get("#password").type("patrick123{enter}"); + cy.get(".ant-form > .ant-btn").click(); + /* ==== End Cypress Studio ==== */ + }); }); diff --git a/client/cypress/e2e/1-getting-started/todo.cy.js b/client/cypress/e2e/1-getting-started/todo.cy.js index 28c0f35e1..87e609ced 100644 --- a/client/cypress/e2e/1-getting-started/todo.cy.js +++ b/client/cypress/e2e/1-getting-started/todo.cy.js @@ -11,133 +11,114 @@ // please read our getting started guide: // https://on.cypress.io/introduction-to-cypress -describe('example to-do app', () => { +describe("example to-do app", () => { + beforeEach(() => { + // Cypress starts out with a blank slate for each test + // so we must tell it to visit our website with the `cy.visit()` command. + // Since we want to visit the same URL at the start of all our tests, + // we include it in our beforeEach function so that it runs before each test + cy.visit("https://example.cypress.io/todo"); + }); + + it("displays two todo items by default", () => { + // We use the `cy.get()` command to get all elements that match the selector. + // Then, we use `should` to assert that there are two matched items, + // which are the two default items. + cy.get(".todo-list li").should("have.length", 2); + + // We can go even further and check that the default todos each contain + // the correct text. We use the `first` and `last` functions + // to get just the first and last matched elements individually, + // and then perform an assertion with `should`. + cy.get(".todo-list li").first().should("have.text", "Pay electric bill"); + cy.get(".todo-list li").last().should("have.text", "Walk the dog"); + }); + + it("can add new todo items", () => { + // We'll store our item text in a variable so we can reuse it + const newItem = "Feed the cat"; + + // Let's get the input element and use the `type` command to + // input our new list item. After typing the content of our item, + // we need to type the enter key as well in order to submit the input. + // This input has a data-test attribute so we'll use that to select the + // element in accordance with best practices: + // https://on.cypress.io/selecting-elements + cy.get("[data-test=new-todo]").type(`${newItem}{enter}`); + + // Now that we've typed our new item, let's check that it actually was added to the list. + // Since it's the newest item, it should exist as the last element in the list. + // In addition, with the two default items, we should have a total of 3 elements in the list. + // Since assertions yield the element that was asserted on, + // we can chain both of these assertions together into a single statement. + cy.get(".todo-list li").should("have.length", 3).last().should("have.text", newItem); + }); + + it("can check off an item as completed", () => { + // In addition to using the `get` command to get an element by selector, + // we can also use the `contains` command to get an element by its contents. + // However, this will yield the