Skip to content

Instantly share code, notes, and snippets.

View magyarmelinda's full-sized avatar

Magyar Melinda Barbara magyarmelinda

View GitHub Profile
$event.type == 1 AND $event.path CONTAINS "Adobe\ Acrobat\ Reader.app/Contents/Info.plist"
$event.type == 3 AND $event.path CONTAINS[cd] ".Trash/Adobe\ Acrobat\ Reader." AND $event.prevFile CONTAINS[cd] "/Applications/Adobe\ Acrobat\ Reader.app"
it('Should Mark a Todo Item As Done And Delete It', () => {
cy.get('#todoText').should('be.empty').and('be.visible').type('Learn About Cypress{enter}')
cy.get('.form-check-input').should('be.visible').check()
cy.get('.pointerMouse').should('be.visible').click()
})
it('Should Add Two New Todos to The List', () => {
cy.get('#todoText').should('be.empty').and('be.visible').type('Learn About Cypress')
cy.get('#addBtn').contains('Add').should('be.visible').click()
cy.get('#todoText').should('be.empty').and('be.visible').type('Learn About Cypress{enter}')
cy.get('.list-group-item').should('be.visible')
cy.get('.list-group > .btn').contains('Delete list').should('be.visible')
})
it('Input Should Have Required Attribute', () => {
cy.get('#todoText').should('have.attr', 'required')
})
it('Page Should Containt The Following Strings', () => {
cy.get('#heading').contains('todolist').should('be.visible')
cy.get('#subHeading').contains('What needs to be done?').should('be.visible')
cy.get('#todoText').should('be.empty').and('be.visible')
cy.get('#addBtn').contains('Add').should('be.visible')
cy.contains('There\'s nothing to do today.').should('be.visible')
})
describe('todolist app', () => {
beforeEach(() => {
cy.visit('/')
})
})
// Show Delete For Content Creator
const deleteOption = (element, content) => {
const elements = document.querySelectorAll(element);
auth.onAuthStateChanged(user => {
if (user) {
for (let i = 0; i < elements.length; i++) {
if (elements[i].id == firebase.auth().currentUser.uid)
elements[i].querySelector(content).classList.remove('display');
else elements[i].querySelector(content).classList.add('display');
// Delete A Comment or A Thread
const deleteContent = (collection, id) => {
let toDelete = db.collection(collection).where(firebase.firestore.FieldPath.documentId(), '==', id);
toDelete.get().then(snapshot => {
snapshot.forEach(doc => {
const data = doc.data();
if (firebase.auth().currentUser.uid == data.user) {
doc.ref.delete().then(() => {
(collection == 'threads') ? getThreads() : setUpComments(data.thread);
});
// Event Listeners
// Reload Home
$$(document).on('click', '.back-link', function () {
$$(document).on('page:init', '.page[data-name="home"]', function () {
window.location.reload();
});
});
// Get Data for Thread Details Page
$$(document).on('click', '.thread-details', function () {