generated from League-of-Foundry-Developers/FoundryVTT-Module-Template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from frondeus/playlistview
Playlist view
- Loading branch information
Showing
75 changed files
with
4,444 additions
and
470 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
export default async function coverMe({ github, context }) { | ||
const diffCoverage = process.env.DIFF_COVERAGE; | ||
const [_, coverageInfo, summary] = diffCoverage | ||
.split('-------------') | ||
.map((s) => s.trim()) | ||
.filter((s) => s.length !== 0); | ||
|
||
// Include a smaller message if there is no coverage information for the diff | ||
|
||
const smallInfo = `\`\`\`\n${coverageInfo}\n\`\`\``; | ||
|
||
const reportBody = !summary | ||
? smallInfo | ||
: `\`\`\` | ||
${summary} | ||
\`\`\` | ||
<details> | ||
<summary>Detailed Coverage Report</summary> | ||
\`\`\` | ||
${coverageInfo} | ||
\`\`\` | ||
</details>`; | ||
|
||
const templatedMessage = `## Coverage Report:\n\n${reportBody}`; | ||
const { data: existingComments } = await github.rest.issues.listComments({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.issue.number | ||
}); | ||
|
||
const githubActionComments = existingComments.filter( | ||
(comment) => | ||
comment.user.login === 'github-actions[bot]' && comment.body.includes('Coverage Report') | ||
); | ||
if (githubActionComments.length) { | ||
const latestComment = githubActionComments.reverse()[0]; | ||
|
||
if (latestComment.body === templatedMessage) { | ||
console.info('Diff comment with the same message already exists - not posting.'); | ||
return; | ||
} | ||
} | ||
|
||
github.rest.issues.createComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.issue.number, | ||
body: templatedMessage | ||
}); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ dist | |
cypress.env.json | ||
cypress/screenshots | ||
cypress/videos | ||
coverage |
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,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npm run format |
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 |
---|---|---|
|
@@ -21,3 +21,4 @@ dist | |
cypress.env.json | ||
cypress/screenshots | ||
cypress/videos | ||
coverage/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
describe('config', () => { | ||
beforeEach(() => { | ||
cy.login('Gamemaster'); | ||
cy.clearWorld(); | ||
cy.mockAPI(); | ||
cy.importPlaylist(); | ||
}); | ||
|
||
it('creates non-syrinscape playlist', () => { | ||
cy.createPlaylist(); | ||
|
||
cy.get('.directory-item.playlist') | ||
.eq(0) | ||
.children('.playlist-header') | ||
.children('.sound-controls') | ||
.children('[data-action="sound-create"]') | ||
.should('not.exist'); | ||
|
||
cy.get('.directory-item.playlist') | ||
.eq(1) | ||
.children('.playlist-header') | ||
.children('.sound-controls') | ||
.children('[data-action="sound-create"]') | ||
.should('be.visible'); | ||
|
||
cy.get('.directory-item.playlist') | ||
.eq(0) | ||
.children('.playlist-header') | ||
.children('.sound-controls') | ||
.children('[data-action="playlist-mode"]') | ||
.should('not.exist'); | ||
|
||
cy.get('.directory-item.playlist') | ||
.eq(1) | ||
.children('.playlist-header') | ||
.children('.sound-controls') | ||
.children('[data-action="playlist-mode"]') | ||
.should('be.visible'); | ||
|
||
cy.get('.directory-item.playlist') | ||
.eq(0) | ||
.children('.playlist-header') | ||
.children('.sound-controls') | ||
.children('[data-action="playlist-play"]') | ||
.should('not.exist'); | ||
|
||
cy.get('.directory-item.playlist') | ||
.eq(1) | ||
.children('.playlist-header') | ||
.children('.sound-controls') | ||
.children('[data-action="playlist-play"]') | ||
.should('be.visible'); | ||
|
||
cy.get('.directory-item.playlist').eq(0).click(); | ||
cy.get('.directory-item.playlist').eq(1).click(); | ||
|
||
cy.get('.directory-item.playlist') | ||
.eq(0) | ||
.children('.playlist-sounds') | ||
.children('.sound') | ||
.children('.sound-controls') | ||
.children('[data-action="sound-play"]') | ||
.should('be.visible'); | ||
|
||
cy.get('.directory-item.playlist') | ||
.eq(1) | ||
.children('.playlist-sounds') | ||
.children('.sound') | ||
.children('.sound-controls') | ||
.children('[data-action="sound-play"]') | ||
.should('be.visible'); | ||
|
||
cy.get('.directory-item.playlist') | ||
.eq(0) | ||
.children('.playlist-sounds') | ||
.children('.sound') | ||
.children('.sound-controls') | ||
.children('[data-action="sound-repeat"]') | ||
.should('not.exist'); | ||
|
||
cy.get('.directory-item.playlist') | ||
.eq(1) | ||
.children('.playlist-sounds') | ||
.children('.sound') | ||
.children('.sound-controls') | ||
.children('[data-action="sound-repeat"]') | ||
.should('be.visible'); | ||
}); | ||
|
||
it('opens syrinscape playlist config', () => { | ||
cy.get('.playlist-name').rightclick(); | ||
|
||
cy.get('.context-items > :nth-child(1)').click(); | ||
|
||
cy.get('[data-test="syrin-playlist-name"]') | ||
.should('be.visible') | ||
.and('contain.value', 'My Room'); | ||
|
||
cy.get('[data-test="syrin-soundset-name"]') | ||
.should('be.visible') | ||
.and('be.disabled') | ||
.and('contain.value', 'My Room'); | ||
|
||
cy.get('[data-test="syrin-controlled"]').should('be.visible'); | ||
}); | ||
|
||
it('opens syrinscape playlist sound config', () => { | ||
cy.get('.playlist-name > .collapse').click(); | ||
|
||
cy.get('.directory-list .sound-name').first().rightclick(); | ||
cy.get('.context-items > :nth-child(1)').click(); | ||
|
||
cy.get('[data-test="syrin-sound-name"]') | ||
.should('be.visible') | ||
.and('contain.value', 'My mood in kitchen'); | ||
|
||
cy.get('[data-test="syrin-soundset-name"]') | ||
.should('be.visible') | ||
.and('be.disabled') | ||
.and('contain.value', 'My Room'); | ||
|
||
cy.get('[data-test="syrin-mood-name"]') | ||
.should('be.visible') | ||
.and('be.disabled') | ||
.and('contain.value', 'My mood in kitchen'); | ||
|
||
cy.get('[data-test="syrin-controlled"]').should('be.visible'); | ||
}); | ||
|
||
it('opens syrinscape ambient sound config', () => { | ||
cy.get('.playlist-name > .collapse').click(); | ||
|
||
cy.get('.directory-list .sound-name').first().as('mood'); | ||
cy.get('#board').as('canvas'); | ||
|
||
cy.get('@mood').should('be.visible'); | ||
|
||
const dataTransfer = new DataTransfer(); | ||
|
||
cy.get('@mood').trigger('dragstart', { dataTransfer }); | ||
|
||
cy.get('@canvas').trigger('drop', { dataTransfer }); | ||
|
||
cy.get('@mood').trigger('dragend'); | ||
|
||
cy.get('[data-test="syrin-soundset-name"]') | ||
.should('be.visible') | ||
.and('be.disabled') | ||
.and('contain.value', 'My Room'); | ||
|
||
cy.get('[data-test="syrin-ambient-name"]') | ||
.should('be.visible') | ||
.and('be.disabled') | ||
.and('contain.value', 'My mood in kitchen'); | ||
|
||
cy.get('[data-test="syrin-x"]').should('be.visible'); | ||
|
||
cy.get('[data-test="syrin-y"]').should('be.visible'); | ||
|
||
cy.get('[data-test="syrin-radius"]').should('be.visible'); | ||
|
||
cy.get('[data-test="syrin-walls"]').should('be.visible'); | ||
|
||
cy.get('[data-test="syrin-darkness-min"]').should('be.visible'); | ||
|
||
cy.get('[data-test="syrin-darkness-max"]').should('be.visible'); | ||
|
||
cy.get('[data-test="syrin-controlled"]').should('be.visible'); | ||
}); | ||
}); |
Oops, something went wrong.