-
Notifications
You must be signed in to change notification settings - Fork 0
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 #103 from cse110-sp24-group26/staging
June 5th Deployment after initial testing
- Loading branch information
Showing
12 changed files
with
3,232 additions
and
141 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 @@ | ||
!.gitignore |
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 {initDB, saveEntry, searchQuery } from '../../src/state/database.js' | ||
|
||
describe('Search Bar Component Test', () => { | ||
beforeEach(() => { | ||
cy.visit('../../build/src/index.html'); | ||
}); | ||
|
||
cy.on('uncaught:exception', (err, runnable) => { | ||
console.error('An error occurred:', err.message); | ||
return false; | ||
}); | ||
|
||
it('Search Bar Component Test', () => { | ||
cy.log("Search Bar Component Test"); | ||
cy.wrap(initDB()).then(() => { | ||
return cy.wrap(saveEntry('2024-10-11', "Text Content", [0, 1])); | ||
}).then(() => { | ||
cy.get('#search-field').should('be.visible').type('Text Content'); | ||
cy.get('#expandable-select').find('div').should('have.length', 1) | ||
.and((options) => { | ||
expect(options.first()).to.contain.text('2024-10-11 "Text Content..."'); | ||
}); | ||
cy.get('#expandable-select').find('div').first().click(); | ||
|
||
const newDate = new Date('2024-10-11T00:00:00'); | ||
|
||
cy.get('m-tab').should('exist').and('have.attr', 'date', newDate.toDateString()); | ||
}); | ||
|
||
cy.wrap(initDB()).then(() => { | ||
return cy.wrap(saveEntry('2024-10-29', "Text Content", [0, 1])); | ||
}).then(() => { | ||
cy.get('#search-field').should('be.visible').type('29'); | ||
cy.get('#expandable-select').find('div').should('have.length', 1) | ||
.and((options) => { | ||
expect(options.first()).to.contain.text('2024-10-29 '); | ||
}); | ||
cy.get('#expandable-select').find('div').first().click(); | ||
|
||
const newDate = new Date('2024-10-29T00:00:00'); | ||
|
||
cy.get('m-tab').should('exist').and('have.attr', 'date', newDate.toDateString()); | ||
}); | ||
|
||
cy.wrap(initDB()).then(() => { | ||
return cy.wrap(saveEntry('2024-10-6', "Text Content", [0, 2])); | ||
}).then(() => { | ||
cy.get('#search-field').should('be.visible').type('Tag 3'); | ||
cy.get('#expandable-select').find('div').should('have.length', 1) | ||
.and((options) => { | ||
expect(options.first()).to.contain.text('2024-10-6 [tag] Tag 3'); | ||
}); | ||
cy.get('#expandable-select').find('div').first().click(); | ||
|
||
const newDate = new Date('2024-10-06T00:00:00'); | ||
|
||
cy.get('m-tab').should('exist').and('have.attr', 'date', newDate.toDateString()); | ||
}); | ||
}); | ||
}); |
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,58 @@ | ||
|
||
//for future reference it is assumed that the date that is initially selected is today's date | ||
describe('Tags Test', () => { | ||
beforeEach(() => { | ||
//visting the html file | ||
cy.visit('../../build/src/index.html'); | ||
}); | ||
|
||
cy.on('uncaught:exception', (err, runnable) => { | ||
console.error('An error occurred:', err.message); | ||
return false; | ||
}); | ||
|
||
//checks if all tags are initially inactive | ||
it('inital tag state', () => { | ||
cy.log("Initial Tag State"); | ||
|
||
//constant number of tags | ||
const TAGS_COUNT = 6; | ||
|
||
//checking that each tag is inactive up inital start up | ||
for(let i = 0; i< TAGS_COUNT; i++){ | ||
cy.get(`#tag-${i}`).should('have.class', 'tag-inactive'); | ||
} | ||
|
||
}); | ||
|
||
//renames a tag and checks if its properly updated | ||
it('tag renaming', async () => { | ||
cy.log("Tag Renaming"); | ||
|
||
//providing a fixed reponse to the subsequent prompt | ||
cy.window().then(win => { | ||
cy.stub(win, 'prompt').returns('New Tag Name'); | ||
}); | ||
|
||
//right-clicking tag-0 | ||
await cy.get('#tag-0').find('button').rightclick(); | ||
|
||
//checking if tag name has been updated | ||
cy.get('#tag-0').within(() => { | ||
cy.get('button').should('have.text', 'New Tag Name'); | ||
}); | ||
|
||
}); | ||
|
||
//toggles to active and checks if its properly updated | ||
it('tag toggling', async () => { | ||
cy.log("Tag Toggling"); | ||
|
||
//initial click of tag-0 on current date | ||
await cy.get('#tag-0').find('button').click(); | ||
|
||
//checking if tag selection was saved (only tag-0 should be active) | ||
cy.get('#tag-0').should('have.class', 'tag-active'); | ||
}); | ||
|
||
}) |
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,54 @@ | ||
function sleep(ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)); | ||
} | ||
|
||
describe('Overall Test', () => { | ||
it('basic search test', () => { | ||
cy.visit('../../build/src/index.html'); | ||
const editor = cy.get('#text-editor'); | ||
editor.type("Text Query"); | ||
|
||
const search = cy.get('m-search-bar').find('#search-field'); | ||
search.type("Text ** \n# hello _italic_ ** bold __"); | ||
sleep(100); | ||
search.type('{enter}'); | ||
search.type('{downArrow}'); | ||
search.type('{upArrow}'); | ||
|
||
cy.get('.selected').should('exist'); | ||
|
||
cy.reload(); | ||
}); | ||
|
||
it('open date test', () => { | ||
cy.visit('../../build/src/index.html'); | ||
|
||
const first = cy.get("#1"); | ||
first.click(); | ||
const second = cy.get("#2"); | ||
second.click(); | ||
|
||
let childrenCount; | ||
cy.get('.tabs').children().then(children => { | ||
childrenCount = children.length; | ||
expect(childrenCount).to.be.greaterThan(2); | ||
}); | ||
|
||
const select = cy.get('.tab-button').first(); | ||
select.click(); | ||
|
||
const close = cy.get(".close-button").first(); | ||
close.click(); | ||
|
||
cy.get('.tabs').children().then(children => { | ||
expect(children.length).to.equal(childrenCount - 1); | ||
}); | ||
|
||
}); | ||
|
||
it('change tag test', () => { | ||
cy.visit('../../build/src/index.html'); | ||
const tag = cy.get('#tag-0').find('button'); | ||
tag.click(); | ||
}); | ||
}) |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.