Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
Feature: doTemplateRender on the Renderer API (#341)
Browse files Browse the repository at this point in the history
* Fixes + deprecations + descriptions

* PR fixes

* Update __tests__/unit/beagle-view/render/template.spec.ts

Co-authored-by: igorgiumellizup <[email protected]>

* Update src/beagle-view/render/types.ts

Co-authored-by: igorgiumellizup <[email protected]>

* Update src/beagle-view/render/index.ts

Co-authored-by: Tiago Peres França <[email protected]>

* Update src/beagle-view/render/template-manager/index.ts

Co-authored-by: Tiago Peres França <[email protected]>

* Update src/beagle-view/render/index.ts

Co-authored-by: Tiago Peres França <[email protected]>

* Update src/beagle-view/render/index.ts

Co-authored-by: Tiago Peres França <[email protected]>

* Update src/beagle-view/render/index.ts

Co-authored-by: Tiago Peres França <[email protected]>

* Update src/beagle-view/render/index.ts

Co-authored-by: Tiago Peres França <[email protected]>

* Update src/beagle-view/render/template-manager/index.ts

Co-authored-by: Tiago Peres França <[email protected]>

* update branch

* Update src/beagle-view/render/types.ts

* PR fixes (3)

* Update __tests__/unit/beagle-view/render/template.spec.ts

Co-authored-by: igorgiumellizup <[email protected]>
Co-authored-by: Tiago Peres França <[email protected]>
  • Loading branch information
3 people authored Jul 2, 2021
1 parent 2f80a93 commit c2cf0c9
Show file tree
Hide file tree
Showing 31 changed files with 10,138 additions and 132 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ root = true
[*]
indent_style = space
indent_size = 2
end_of_line = crlf
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export function setupHomeActionsTest() {
* suit. Here, besides creating the beagle remote view, we wait for the first three renders to
* finish and clear the mocks.
*/
async function createRemoteViewAndWaitInitialRendering() {
const { render, view } = await createBeagleRemoteView({ route: '/home' })
async function createRemoteViewAndWaitInitialRendering(route: string = '/home') {
const { render, view } = await createBeagleRemoteView({ route })
await whenCalledTimes(render, 3)
const tree = render.mock.calls[2][0]
render.mockClear()
Expand Down
16 changes: 10 additions & 6 deletions __tests__/integration/beagle-keep/assertions/backend.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('Beagle Keep: backend', () => {
})

it('should not get labels', () => testErrorResponse('label'))

it('should edit label', async () => {
const label = { ...getLabels()[0] }
label.name = 'Edited'
Expand All @@ -71,7 +71,7 @@ describe('Beagle Keep: backend', () => {
})

it('should not edit label', () => testErrorResponse('label', '', { method: 'put' }))

it('should create label', async () => {
const originalLabels = [...getLabels()]
const label = { name: 'new', id: '', color: '#000' }
Expand All @@ -84,7 +84,7 @@ describe('Beagle Keep: backend', () => {
})

it('should not create label', () => testErrorResponse('label', '', { method: 'post' }))

it('should remove label', async () => {
const originalLabels = [...getLabels()]
const request = { method: 'delete' }
Expand Down Expand Up @@ -113,7 +113,7 @@ describe('Beagle Keep: backend', () => {
})

it('should not get note by id', () => testErrorResponse('note', '/0'))

it('should edit note', async () => {
const note = { ...getNoteById(0)! }
note.title = 'Edited'
Expand All @@ -125,7 +125,7 @@ describe('Beagle Keep: backend', () => {
})

it('should not edit note', () => testErrorResponse('note', '', { method: 'put' }))

it('should create note', async () => {
const originalNotes = [...getNotes()]
const note = { title: 'new', id: '', text: 'blah', labels: [getLabels()[0]] }
Expand All @@ -138,7 +138,7 @@ describe('Beagle Keep: backend', () => {
})

it('should not create note', () => testErrorResponse('note', '', { method: 'post' }))

it('should remove note', async () => {
const originalNotes = [...getNotes()]
const request = { method: 'delete' }
Expand All @@ -160,6 +160,10 @@ describe('Beagle Keep: backend', () => {

it('should not get home', () => testErrorResponse('view', '/home'))

it('should get templated home', () => shouldGetView('/templatedHome'))

it('should not get templated home', () => testErrorResponse('view', '/templatedHome'))

it('should get details', () => shouldGetView('/details'))

it('should not get details', () => testErrorResponse('view', '/details'))
Expand Down
Loading

0 comments on commit c2cf0c9

Please sign in to comment.