-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(arch): move && simplify component content-addon
- Loading branch information
Showing
71 changed files
with
224 additions
and
290 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
39 changes: 39 additions & 0 deletions
39
packages-new/components/content-addon/documentation/specifications/spec.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
* [**Classes**](#classes) | ||
* [**Type alias**](#type-alias) | ||
* [**Variables**](#variables) | ||
|
||
## Classes | ||
|
||
### OdsContentAddonController | ||
_common controller logic for content-addon component used by the different implementations._ | ||
_it contains all the glue between framework implementation and the third party service._ | ||
|
||
|
||
## Type alias | ||
|
||
### OdsContentAddon | ||
|
||
interface description of all implementation of `ods-content-addon`. | ||
each implementation must have defined events, methods, attributes | ||
and one controller for the common behavior logic | ||
|
||
> - `OdsComponentGenericMethods` | ||
> - `OdsComponentGenericEvents` | ||
### OdsContentAddonAttributes | ||
|
||
> _Based on `OdsComponentAttributes`_ | ||
### OdsContentAddonEvents | ||
|
||
> _Based on `OdsComponentEvents`_ | ||
### OdsContentAddonMethods | ||
|
||
> _Based on `OdsComponentMethods`_ | ||
## Variables | ||
|
||
### odsContentAddonDefaultAttributes | ||
`OdsContentAddonAttributes` |
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
...nt-addon/specifications-content-addon.mdx → ...ications/specifications-content-addon.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...-new/components/content-addon/src/components/osds-content-addon/osds-content-addon.e2e.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import type { E2EElement, E2EPage } from '@stencil/core/testing'; | ||
import { OdsLogger } from '@ovhcloud/ods-common-core'; | ||
import { newE2EPage } from '@stencil/core/testing'; | ||
|
||
const logger = new OdsLogger('osds-content-addon-e2e'); | ||
|
||
describe('e2e:osds-content-addon', () => { | ||
let page: E2EPage; | ||
let el: E2EElement; | ||
|
||
async function setup() { | ||
page = await newE2EPage(); | ||
await page.setContent(`<osds-content-addon></osds-content-addon>`); | ||
await page.evaluate(() => document.body.style.setProperty('margin', '0px')); | ||
|
||
el = await page.find('osds-content-addon'); | ||
|
||
const root = await page.find('osds-content-addon'); | ||
const activeElId = await page.evaluate(() => document); | ||
logger.log(activeElId); | ||
logger.log(root); | ||
} | ||
|
||
it('should render', async () => { | ||
await setup(); | ||
expect(el).not.toBeNull(); | ||
expect(el).toHaveClass('hydrated'); | ||
}); | ||
}); |
File renamed without changes.
60 changes: 60 additions & 0 deletions
60
...new/components/content-addon/src/components/osds-content-addon/osds-content-addon.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import type { SpecPage } from '@stencil/core/testing'; | ||
import { newSpecPage } from '@stencil/core/testing'; | ||
import { OsdsContentAddon } from './osds-content-addon'; | ||
|
||
describe('spec:osds-content-addon', () => { | ||
let page: SpecPage; | ||
let slotTop: HTMLElement | null | undefined; | ||
let slotBottom: HTMLElement | null | undefined; | ||
let slotStart: HTMLElement | null | undefined; | ||
let slotEnd: HTMLElement | null | undefined; | ||
let slotMain: HTMLElement | null | undefined; | ||
|
||
async function setup() { | ||
page = await newSpecPage({ | ||
components: [OsdsContentAddon], | ||
html: `<osds-content-addon></osds-content-addon>`, | ||
}); | ||
|
||
// note: assigned slot not yet available in HtmlMockedElement of stencil : https://github.com/ionic-team/stencil/issues/2830 | ||
slotTop = page.root?.shadowRoot?.querySelector('slot[name=top]'); | ||
slotBottom = page.root?.shadowRoot?.querySelector('slot[name=bottom]'); | ||
slotStart = page.root?.shadowRoot?.querySelector('slot[name=start]'); | ||
slotEnd = page.root?.shadowRoot?.querySelector('slot[name=end]'); | ||
slotMain = page.root?.shadowRoot?.querySelector('slot[name=main]'); | ||
} | ||
|
||
it('should render', async () => { | ||
await setup(); | ||
expect(page.root?.shadowRoot).toBeTruthy(); | ||
expect(page.rootInstance).toBeTruthy(); | ||
}); | ||
|
||
|
||
describe('contents', () => { | ||
it('should have a top slot', async () => { | ||
await setup(); | ||
expect(slotTop).toBeTruthy(); | ||
}); | ||
|
||
it('should have a bottom slot', async () => { | ||
await setup(); | ||
expect(slotBottom).toBeTruthy(); | ||
}); | ||
|
||
it('should have a start slot', async () => { | ||
await setup(); | ||
expect(slotStart).toBeTruthy(); | ||
}); | ||
|
||
it('should have an end slot', async () => { | ||
await setup(); | ||
expect(slotEnd).toBeTruthy(); | ||
}); | ||
|
||
it('should have a main slot', async () => { | ||
await setup(); | ||
expect(slotMain).toBeTruthy(); | ||
}); | ||
}); | ||
}); |
9 changes: 3 additions & 6 deletions
9
...osds-content-addon/osds-content-addon.tsx → ...osds-content-addon/osds-content-addon.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages-new/components/content-addon/src/components/osds-content-addon/public-api.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { OsdsContentAddon } from './osds-content-addon'; |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...don/src/docs/osds-content-addon/usage.mdx → ...don/src/docs/osds-content-addon/usage.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...cil/components/content-addon/typedoc.json → ...new/components/content-addon/typedoc.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.