Skip to content

Commit

Permalink
Bumoed version
Browse files Browse the repository at this point in the history
Label background to ensure legible on white bg
move some text code outside of beforeAll for speed
  • Loading branch information
Mattk70 committed Nov 22, 2024
1 parent 4035219 commit c70f9f3
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 25 deletions.
10 changes: 7 additions & 3 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,13 @@ ul {
region.wavesurfer-region:before {
content: attr(data-region-label);
position: absolute;
color: beige;
top: 10px;
padding-left: 5px;
color: beige;
background-color: rgba(0, 0, 0, 0.3); /* Semi-transparent black background */
border-radius: 0.5rem; /* Optional: Rounds corners for a cleaner look */
padding: 0.1rem 0.5rem; /* Adds padding around the label text */
top: 0.75rem;
left: 0.5rem;
padding-left: 0.5rem;
}

region.wavesurfer-region[data-region-highlight] {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chirpity",
"version": "2.4.4",
"version": "2.4.5",
"description": "Chirpity Nocmig",
"main": "main.js",
"scripts": {
Expand Down
14 changes: 7 additions & 7 deletions test/menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ let electronApp: ElectronApplication;
let page: Page;
let worker: Page;
let example_file: any

// find the latest build in the out directory
const latestBuild = findLatestBuild('./dist')
// parse the directory and find paths and other info
const appInfo = parseElectronApp(latestBuild)
// set the CI environment variable to true
process.env.CI = 'e2e';
test.beforeAll(async () => {
// find the latest build in the out directory
const latestBuild = findLatestBuild('./dist')
// parse the directory and find paths and other info
const appInfo = parseElectronApp(latestBuild)
// set the CI environment variable to true
process.env.CI = 'e2e';

electronApp = await electron.launch({
args: [appInfo.main],
executablePath: appInfo.executable,
Expand Down
31 changes: 17 additions & 14 deletions test/record.creation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ let electronApp: ElectronApplication;
let page: Page;
let worker: Page;
let example_file: any
// find the latest build in the out directory
const latestBuild = findLatestBuild('./dist')
// parse the directory and find paths and other info
const appInfo = parseElectronApp(latestBuild)
// set the CI environment variable to true
process.env.CI = 'e2e';

test.beforeAll(async () => {
// find the latest build in the out directory
const latestBuild = findLatestBuild('./dist')
// parse the directory and find paths and other info
const appInfo = parseElectronApp(latestBuild)
// set the CI environment variable to true
process.env.CI = 'e2e';

electronApp = await electron.launch({
args: [appInfo.main],
executablePath: appInfo.executable,
Expand All @@ -36,7 +37,6 @@ test.beforeAll(async () => {
}

})

// Get the path for the example file we want to load
example_file = await ipcMainInvokeHandler(electronApp, 'getAudio')
await stubMultipleDialogs(electronApp, [
Expand Down Expand Up @@ -134,13 +134,16 @@ test('Can create/edit a manual record', async () => {
console.log('record creation test: before 4th expect')
expect(callCount).toBe('3');
await page.keyboard.press('ControlOrMeta+s');
await page.waitForTimeout(1000);
const filename = await page.locator('#filename span.filename');
// File name is blue - saved
const hasClass = await filename.evaluate(el => el.classList.contains('text-info'));

console.log('record creation test: before final expect', hasClass)
expect(hasClass).toBe(true)
await page.waitForFunction(
({selector, className}) => {
const element = document.querySelector(selector);
return element && element.classList.contains(className);
},
{ timeout: 5000, // Adjust timeout as needed
selector: '#filename span.filename', // Selector
className: 'text-info'} // Class to wait for
);

console.log('record creation test: complete')
})

Expand Down

0 comments on commit c70f9f3

Please sign in to comment.