Skip to content

Commit

Permalink
chore(atomic): migrate to Tailwindcss v3 (#1718)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibodeauJF authored Feb 9, 2022
1 parent abf0ec0 commit 226ce20
Show file tree
Hide file tree
Showing 12 changed files with 1,529 additions and 1,354 deletions.
9 changes: 8 additions & 1 deletion packages/atomic/cypress/fixtures/test-fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class TestFixture {
private translations: Record<string, string> = {};
private responseModifiers: SearchResponseModifierPredicate[] = [];
private returnError = false;
private redirected = false;

public with(feat: TestFeature) {
feat(this);
Expand Down Expand Up @@ -77,6 +78,11 @@ export class TestFixture {
return this;
}

public withRedirection() {
this.redirected = true;
return this;
}

public withFieldCaptions(field: string, captions: Record<string, string>) {
this.fieldCaptions.push({field, captions});
return this;
Expand Down Expand Up @@ -118,7 +124,8 @@ export class TestFixture {
}

public init() {
cy.visit(buildTestUrl(this.hash)).injectAxe();
!this.redirected && cy.visit(buildTestUrl(this.hash));
cy.injectAxe();
this.intercept();
this.stubConsole();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('Standalone Search Box Test Suites', () => {
}

function setupStandardSearchBox() {
new TestFixture().with(addSearchBox()).init();
new TestFixture().withRedirection().with(addSearchBox()).init();
}

it('should redirect to the default url when a search is submitted', () => {
Expand All @@ -41,8 +41,8 @@ describe('Standalone Search Box Test Suites', () => {

describe('when being redirected to an Atomic Search Interface after submitting a query', () => {
const query = 'hello';
before(() => {
setupStandaloneSearchBox('/test.html');
beforeEach(() => {
setupStandaloneSearchBox();
SearchBoxSelectors.inputBox().type(query);
SearchBoxSelectors.submitButton().click();
setupStandardSearchBox();
Expand All @@ -54,8 +54,8 @@ describe('Standalone Search Box Test Suites', () => {

describe('when being redirected to an Atomic Search Interface after selecting a suggestion', () => {
const query = 'awards';
before(() => {
setupStandaloneSearchBox('/test.html');
beforeEach(() => {
setupStandaloneSearchBox();
SearchBoxSelectors.inputBox().type(query);
SearchBoxSelectors.querySuggestions().eq(0).click();
setupStandardSearchBox();
Expand Down
Loading

0 comments on commit 226ce20

Please sign in to comment.