Skip to content

Commit

Permalink
feat: nuxt module official structure
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarosabu committed Jun 28, 2023
1 parent 48a7dec commit e8fa706
Show file tree
Hide file tree
Showing 43 changed files with 17,045 additions and 10,479 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
node_modules
playground-e2e
7 changes: 7 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"root": true,
"extends": ["@nuxt/eslint-config"],
"rules": {
"vue/multi-word-component-names": "off"
}
}
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shamefully-hoist=true
strict-peer-dependencies=false
1 change: 1 addition & 0 deletions .nuxtrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
typescript.includeWorkspace=true
11 changes: 11 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from "cypress";

export default defineConfig({
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
baseUrl: "http://localhost:3002",
viewportWidth: 1600,
viewportHeight: 1400
}
});
3 changes: 3 additions & 0 deletions cypress/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["plugin:cypress/recommended"]
}
34 changes: 34 additions & 0 deletions cypress/e2e/index.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
describe("@storyblok/nuxt", () => {
describe("Composition API", () => {
beforeEach(() => {
// cy.intercept("https://api.storyblok.com/**", {
// fixture: "stories.json"
// }).as("getStories");
cy.visit("/test");
});

it("should fetch and render stories", () => {
it("Renders the expected story when loading the components", () => {
cy.get("[data-test=page]").should("exist");
cy.get("[data-test=grid]").should("exist");
cy.get("[data-test=feature]").should("have.length", 2);
cy.get("[data-test=teaser]").should("exist").and("have.text", "hello");
});
});
});

describe("Composition API - Long form", () => {
beforeEach(() => {
cy.visit("/vcalong");
});

it("should fetch and render stories", () => {
it("Renders the expected story when loading the components", () => {
cy.get("[data-test=page]").should("exist");
cy.get("[data-test=grid]").should("exist");
cy.get("[data-test=feature]").should("have.length", 2);
cy.get("[data-test=teaser]").should("exist").and("have.text", "hello");
});
});
});
});
7 changes: 7 additions & 0 deletions cypress/fixtures/stories.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"stories": [
{ "name": "a", "id": 0 },
{ "name": "b", "id": 1 },
{ "name": "c", "id": 2 }
]
}
25 changes: 25 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
20 changes: 20 additions & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import "./commands";

// Alternatively you can use CommonJS syntax:
// require('./commands')
Binary file added cypress/videos/index.cy.ts.mp4
Binary file not shown.
Loading

0 comments on commit e8fa706

Please sign in to comment.