Skip to content

Commit

Permalink
all specs passing with new lit
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed May 22, 2021
1 parent 16567a5 commit 209feae
Show file tree
Hide file tree
Showing 12 changed files with 201 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plugin-graphql-test-children-query",
"dependencies": {
"lit-element": "^2.4.0"
"lit": "^2.0.0-rc.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,41 +55,76 @@ describe('Build Greenwood With: ', function() {
`${process.cwd()}/packages/plugin-graphql/src/queries/*.gql`,
`${outputPath}/node_modules/@greenwood/plugin-graphql/src/queries/`
);
const litElementLibs = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-element/lib/*.js`,
`${outputPath}/node_modules/lit-element/lib/`
const lit = await getDependencyFiles(
`${process.cwd()}/node_modules/lit/*.js`,
`${outputPath}/node_modules/lit/`
);
const litDecorators = await getDependencyFiles(
`${process.cwd()}/node_modules/lit/decorators/*.js`,
`${outputPath}/node_modules/lit/decorators/`
);
const litDirectives = await getDependencyFiles(
`${process.cwd()}/node_modules/lit/directives/*.js`,
`${outputPath}/node_modules/lit/directives/`
);
const litPackageJson = await getDependencyFiles(
`${process.cwd()}/node_modules/lit/package.json`,
`${outputPath}/node_modules/lit/`
);
const litElement = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-element/lit-element.js`,
`${process.cwd()}/node_modules/lit-element/*.js`,
`${outputPath}/node_modules/lit-element/`
);
const litElementPackageJson = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-element/package.json`,
`${outputPath}/node_modules/lit-element/`
);
const litElementDecorators = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-element/decorators/*.js`,
`${outputPath}/node_modules/lit-element/decorators/`
);
const litHtml = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-html/lit-html.js`,
`${process.cwd()}/node_modules/lit-html/*.js`,
`${outputPath}/node_modules/lit-html/`
);
const litHtmlPackageJson = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-html/package.json`,
`${outputPath}/node_modules/lit-html/`
);
const litHtmlLibs = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-html/lib/*.js`,
`${outputPath}/node_modules/lit-html/lib/`
const litHtmlDirectives = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-html/directives/*.js`,
`${outputPath}/node_modules/lit-html/directives/`
);
const litReactiveElement = await getDependencyFiles(
`${process.cwd()}/node_modules/@lit/reactive-element/*.js`,
`${outputPath}/node_modules/@lit/reactive-element/`
);
const litReactiveElementDecorators = await getDependencyFiles(
`${process.cwd()}/node_modules/@lit/reactive-element/decorators/*.js`,
`${outputPath}/node_modules/@lit/reactive-element/decorators/`
);
const litReactiveElementPackageJson = await getDependencyFiles(
`${process.cwd()}/node_modules/@lit/reactive-element/package.json`,
`${outputPath}/node_modules/@lit/reactive-element/`
);

await runner.setup(outputPath, [
...getSetupFiles(outputPath),
...greenwoodGraphqlCoreLibs,
...greenwoodGraphqlQueryLibs,
...litElement,
...lit,
...litPackageJson,
...litDirectives,
...litDecorators,
...litElementPackageJson,
...litElementLibs,
...litHtml,
...litElement,
...litElementDecorators,
...litHtmlPackageJson,
...litHtmlLibs
...litHtml,
...litHtmlDirectives,
...litReactiveElement,
...litReactiveElementDecorators,
...litReactiveElementPackageJson
]);
await runner.runCommand(cliPath, 'build');
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { html, LitElement } from 'lit-element';
import { html, LitElement } from 'lit';
import client from '@greenwood/plugin-graphql/core/client';
import ChildrenQuery from '@greenwood/plugin-graphql/queries/children';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plugin-graphql-test-query-custom-frontmatter",
"dependencies": {
"lit-element": "^2.4.0"
"lit": "^2.0.0-rc.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,41 +57,76 @@ describe('Build Greenwood With: ', function() {
`${process.cwd()}/packages/plugin-graphql/src/queries/*.gql`,
`${outputPath}/node_modules/@greenwood/plugin-graphql/src/queries/`
);
const litElementLibs = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-element/lib/*.js`,
`${outputPath}/node_modules/lit-element/lib/`
const lit = await getDependencyFiles(
`${process.cwd()}/node_modules/lit/*.js`,
`${outputPath}/node_modules/lit/`
);
const litDecorators = await getDependencyFiles(
`${process.cwd()}/node_modules/lit/decorators/*.js`,
`${outputPath}/node_modules/lit/decorators/`
);
const litDirectives = await getDependencyFiles(
`${process.cwd()}/node_modules/lit/directives/*.js`,
`${outputPath}/node_modules/lit/directives/`
);
const litPackageJson = await getDependencyFiles(
`${process.cwd()}/node_modules/lit/package.json`,
`${outputPath}/node_modules/lit/`
);
const litElement = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-element/lit-element.js`,
`${process.cwd()}/node_modules/lit-element/*.js`,
`${outputPath}/node_modules/lit-element/`
);
const litElementPackageJson = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-element/package.json`,
`${outputPath}/node_modules/lit-element/`
);
const litElementDecorators = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-element/decorators/*.js`,
`${outputPath}/node_modules/lit-element/decorators/`
);
const litHtml = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-html/lit-html.js`,
`${process.cwd()}/node_modules/lit-html/*.js`,
`${outputPath}/node_modules/lit-html/`
);
const litHtmlPackageJson = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-html/package.json`,
`${outputPath}/node_modules/lit-html/`
);
const litHtmlLibs = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-html/lib/*.js`,
`${outputPath}/node_modules/lit-html/lib/`
const litHtmlDirectives = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-html/directives/*.js`,
`${outputPath}/node_modules/lit-html/directives/`
);
const litReactiveElement = await getDependencyFiles(
`${process.cwd()}/node_modules/@lit/reactive-element/*.js`,
`${outputPath}/node_modules/@lit/reactive-element/`
);
const litReactiveElementDecorators = await getDependencyFiles(
`${process.cwd()}/node_modules/@lit/reactive-element/decorators/*.js`,
`${outputPath}/node_modules/@lit/reactive-element/decorators/`
);
const litReactiveElementPackageJson = await getDependencyFiles(
`${process.cwd()}/node_modules/@lit/reactive-element/package.json`,
`${outputPath}/node_modules/@lit/reactive-element/`
);

await runner.setup(outputPath, [
...getSetupFiles(outputPath),
...greenwoodGraphqlCoreLibs,
...greenwoodGraphqlQueryLibs,
...litElement,
...lit,
...litPackageJson,
...litDirectives,
...litDecorators,
...litElementPackageJson,
...litElementLibs,
...litHtml,
...litElement,
...litElementDecorators,
...litHtmlPackageJson,
...litHtmlLibs
...litHtml,
...litHtmlDirectives,
...litReactiveElement,
...litReactiveElementDecorators,
...litReactiveElementPackageJson
]);
await runner.runCommand(cliPath, 'build');
});
Expand Down Expand Up @@ -160,11 +195,12 @@ describe('Build Greenwood With: ', function() {
expect(authors.length).to.be.equal(2);
expect(dates.length).to.be.equal(2);

expect(authors[0].innerHTML).to.be.contain('Written By: [email protected]');
expect(dates[0].innerHTML).to.be.contain('On: 07.08.2020');
// account for dynamic hydration markers added by lit
expect(authors[0].innerHTML).to.match(/Written By:(.*.)[email protected]/);
expect(dates[0].innerHTML).to.match(/On:(.*.)07.08.2020/);

expect(authors[1].innerHTML).to.be.contain('Written By: [email protected]');
expect(dates[1].innerHTML).to.be.contain('On: 07.09.2020');
expect(authors[1].innerHTML).to.match(/Written By:(.*.)[email protected]/);
expect(dates[1].innerHTML).to.match(/On:(.*.)07.09.2020/);
});
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { html, LitElement } from 'lit-element';
import { html, LitElement } from 'lit';
import client from '@greenwood/plugin-graphql/core/client';

class PostsListTemplate extends LitElement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plugin-graphql-test-graph-query",
"dependencies": {
"lit-element": "^2.4.0"
"lit": "^2.0.0-rc.2"
}
}
59 changes: 47 additions & 12 deletions packages/plugin-graphql/test/cases/query-graph/query-graph.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,41 +53,76 @@ describe('Build Greenwood With: ', function() {
`${process.cwd()}/packages/plugin-graphql/src/queries/*.gql`,
`${outputPath}/node_modules/@greenwood/plugin-graphql/src/queries/`
);
const litElementLibs = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-element/lib/*.js`,
`${outputPath}/node_modules/lit-element/lib/`
const lit = await getDependencyFiles(
`${process.cwd()}/node_modules/lit/*.js`,
`${outputPath}/node_modules/lit/`
);
const litDecorators = await getDependencyFiles(
`${process.cwd()}/node_modules/lit/decorators/*.js`,
`${outputPath}/node_modules/lit/decorators/`
);
const litDirectives = await getDependencyFiles(
`${process.cwd()}/node_modules/lit/directives/*.js`,
`${outputPath}/node_modules/lit/directives/`
);
const litPackageJson = await getDependencyFiles(
`${process.cwd()}/node_modules/lit/package.json`,
`${outputPath}/node_modules/lit/`
);
const litElement = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-element/lit-element.js`,
`${process.cwd()}/node_modules/lit-element/*.js`,
`${outputPath}/node_modules/lit-element/`
);
const litElementPackageJson = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-element/package.json`,
`${outputPath}/node_modules/lit-element/`
);
const litElementDecorators = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-element/decorators/*.js`,
`${outputPath}/node_modules/lit-element/decorators/`
);
const litHtml = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-html/lit-html.js`,
`${process.cwd()}/node_modules/lit-html/*.js`,
`${outputPath}/node_modules/lit-html/`
);
const litHtmlPackageJson = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-html/package.json`,
`${outputPath}/node_modules/lit-html/`
);
const litHtmlLibs = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-html/lib/*.js`,
`${outputPath}/node_modules/lit-html/lib/`
const litHtmlDirectives = await getDependencyFiles(
`${process.cwd()}/node_modules/lit-html/directives/*.js`,
`${outputPath}/node_modules/lit-html/directives/`
);
const litReactiveElement = await getDependencyFiles(
`${process.cwd()}/node_modules/@lit/reactive-element/*.js`,
`${outputPath}/node_modules/@lit/reactive-element/`
);
const litReactiveElementDecorators = await getDependencyFiles(
`${process.cwd()}/node_modules/@lit/reactive-element/decorators/*.js`,
`${outputPath}/node_modules/@lit/reactive-element/decorators/`
);
const litReactiveElementPackageJson = await getDependencyFiles(
`${process.cwd()}/node_modules/@lit/reactive-element/package.json`,
`${outputPath}/node_modules/@lit/reactive-element/`
);

await runner.setup(outputPath, [
...getSetupFiles(outputPath),
...greenwoodGraphqlCoreLibs,
...greenwoodGraphqlQueryLibs,
...litElement,
...lit,
...litPackageJson,
...litDirectives,
...litDecorators,
...litElementPackageJson,
...litElementLibs,
...litHtml,
...litElement,
...litElementDecorators,
...litHtmlPackageJson,
...litHtmlLibs
...litHtml,
...litHtmlDirectives,
...litReactiveElement,
...litReactiveElementDecorators,
...litReactiveElementPackageJson
]);
await runner.runCommand(cliPath, 'build');
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { html, LitElement } from 'lit-element';
import { html, LitElement } from 'lit';
import client from '@greenwood/plugin-graphql/core/client';
import GraphQuery from '@greenwood/plugin-graphql/queries/graph';

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-graphql/test/cases/query-menu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plugin-graphql-test-menu-query",
"dependencies": {
"lit-element": "^2.4.0"
"lit": "^2.0.0-rc.2"
}
}
Loading

0 comments on commit 209feae

Please sign in to comment.