Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Myllaume committed Jul 11, 2024
1 parent 7746201 commit 21efd06
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
14 changes: 13 additions & 1 deletion e2e/graph.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,21 @@ describe('graph', () => {
'Evergreen notes should bedensely linked',
'Evergreen notes',
'Tools for thought',
// bibliographic nodes
'Augmenting Human Intellect:A Conceptual Framework',
'How can we develop transformativetools for thought?',
]);

cy.visit('temp/no-citeproc.html');

cy.shouldGraphHasNodes([
'Evergreen note titles arelike APIs',
'Evergreen notes should beatomic',
'Evergreen notes should beconcept-oriented',
'Evergreen notes should bedensely linked',
'Evergreen notes',
'Tools for thought',
]);
});

it('should open record on click on node', () => {
Expand Down Expand Up @@ -69,7 +81,7 @@ describe('graph', () => {
);
});

it.only('should not if option is unactivated', () => {
it('should not if option is unactivated', () => {
cy.contains('Paramètres du graphe').click();
cy.contains('Surbrillance au survol').as('option');

Expand Down
53 changes: 53 additions & 0 deletions e2e/record.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,22 @@ describe('Record', () => {
assertRecordIsOpened();
});

it('should click on record links redirect to record', () => {
cy.get('[data-node="evergreen notes should be densely linked"]').click();

cy.get('.record.active .record-content').find('a').should('have.length', 1).click();

assertRecordIsOpened();
});

it('should click on link from footer list redirect to record', () => {
cy.get('[data-node="evergreen notes should be densely linked"]').click();

cy.get('.record.active footer').contains('Evergreen notes should be concept-oriented').click();

assertRecordIsOpened();
});

describe('Have click on node', () => {
beforeEach(() => {
cy.get('[data-node="evergreen notes should be concept-oriented"]').click();
Expand Down Expand Up @@ -138,4 +154,41 @@ describe('Record', () => {
'MATUSCHAK, Andy et NIELSEN, Michael, 2019',
);
});

describe('footer', () => {
beforeEach(() => {
cy.get('[data-node="tools for thought"]').click();
cy.get('.record.active footer').as('footer');

cy.get('@footer').find('.record-links-list li').should('have.length', 2).eq(0).as('link');

cy.get('@footer')
.find('.record-backlinks-list li')
.should('have.length', 1)
.eq(0)
.as('backlink');
});

it('should contains link to source/target node', () => {
cy.get('@link').should('have.attr', 'data-target-id', 'engelbart1962');
cy.get('@link').find('a').should('have.attr', 'href', '#engelbart1962');

cy.get('@backlink').should('have.attr', 'data-target-id', 'evergreen notes');
cy.get('@backlink').find('a').should('have.attr', 'href', '#evergreen notes');
});

it('should contains context and mark of relationship', () => {
cy.get('@link').should(
'contains.text',
'(Engelbart, 1962 ; quoted by Matuschak, Nielsen, 2019).',
);
cy.get('@link').find('.highlight').should('have.text', 'Engelbart, 1962');

cy.get('@backlink').should(
'contains.text',
'Evergreen notes can be created with tools for thought.',
);
cy.get('@backlink').find('.highlight').should('have.text', 'tools for thought');
});
});
});

0 comments on commit 21efd06

Please sign in to comment.