mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-11 00:56:25 +02:00
test for JS library selector
This commit is contained in:
@ -141,6 +141,7 @@ describe('Testing interfaces', () => {
|
|||||||
|
|
||||||
// check for the saved projects
|
// check for the saved projects
|
||||||
cy.get('#openItemsBtn').click();
|
cy.get('#openItemsBtn').click();
|
||||||
|
cy.get('#js-saved-items-wrap').should('be.visible');
|
||||||
messages.forEach((m, index) => {
|
messages.forEach((m, index) => {
|
||||||
cy.get('#js-saved-items-wrap')
|
cy.get('#js-saved-items-wrap')
|
||||||
.children()
|
.children()
|
||||||
@ -148,4 +149,29 @@ describe('Testing interfaces', () => {
|
|||||||
.contains(m);
|
.contains(m);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('Selecting a library from dropdown should change URL in textarea', () => {
|
||||||
|
cy.get('[data-testid=addLibraryButton]').click();
|
||||||
|
|
||||||
|
cy.get('#externalJsTextarea').should('exist');
|
||||||
|
cy.get('#externalCssTextarea').should('exist');
|
||||||
|
|
||||||
|
const checkLibrary = (label, url, type) => {
|
||||||
|
cy.get('#js-add-library-select').select(label);
|
||||||
|
|
||||||
|
cy.get(`#external${type}Textarea`).should('contain.value', '\n' + url); // \n because every url should be in a new line
|
||||||
|
};
|
||||||
|
|
||||||
|
cy.fixture('libraries').then(data => {
|
||||||
|
data['jsLibs'].forEach(lib =>
|
||||||
|
checkLibrary(lib['label'], lib['urlPref'], 'Js')
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
cy.fixture('libraries').then(data => {
|
||||||
|
data['csLibs'].forEach(lib =>
|
||||||
|
checkLibrary(lib['label'], lib['urlPref'], 'Css')
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user