Skip to content

Commit

Permalink
feat(Address Finder 4): Upgrade to Address Finder 4 (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
cblanc authored Aug 9, 2022
1 parent 7e8d03b commit e477a89
Show file tree
Hide file tree
Showing 9 changed files with 29,933 additions and 409 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ For instance, follow the instructions on [jsdelivr.com/address-finder-bundled](h

<script>
IdealPostcodes.AddressFinder.setup({
apiKey: "iddqd",
apiKey: "ak_test",
inputField: "#line_1",
outputFields: {
line_1: "#line_1",
Expand All @@ -92,7 +92,7 @@ For instance, follow the instructions on [jsdelivr.com/address-finder-bundled](h
<script type="module">
import { AddressFinder } from "https://cdn.jsdelivr.net/npm/@ideal-postcodes/address-finder-bundled@2/dist/address-finder.esm.js";
AddressFinder.setup({
apiKey: "iddqd",
apiKey: "ak_test",
inputField: "#line_1",
outputFields: {
line_1: "#line_1",
Expand Down
8 changes: 4 additions & 4 deletions cypress/integration/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@

describe("Autocomplete", () => {
it("mouse select", () => {
cy.get("#line_1").clear({ force: true }).type("L L Consultancy Ltd", { force: true });
cy.get("#line_1").clear({ force: true }).type("M L Roberts Ltd", { force: true });
cy.wait(1000);
cy.get(".idpc_ul li").first().click()
cy.wait(1000);
cy.get("#line_1").should('have.value', 'L L Consultancy Ltd');
cy.get("#line_1").should('have.value', 'M L Roberts Ltd');
cy.get("#line_2").should('have.value', '2 Stamford Square');
cy.get("#post_town").should('have.value', 'London');
cy.get("#postcode").should('have.value', 'SW15 2BF');
cy.wait(1000);
});
it("key select", () => {
cy.get("#line_1").clear({ force: true }).type("L L Consultancy Ltd", { force: true });
cy.get("#line_1").clear({ force: true }).type("M L Roberts Ltd", { force: true });
cy.wait(1000);
cy.get("#line_1").type("{downarrow}", { force: true }).type("{enter}", { force: true });
cy.wait(1000);
cy.get("#line_1").should('have.value', 'L L Consultancy Ltd');
cy.get("#line_1").should('have.value', 'M L Roberts Ltd');
cy.get("#line_2").should('have.value', '2 Stamford Square');
cy.get("#post_town").should('have.value', 'London');
cy.get("#postcode").should('have.value', 'SW15 2BF');
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ declare global {
Cypress.Commands.add("setup", (url) => {
cy.visit(url, {
onBeforeLoad: (window) => {
window.apiKey = Cypress.env("API_KEY") || "iddqd";
window.apiKey = Cypress.env("API_KEY") || "ak_test";
},
});
});
2 changes: 1 addition & 1 deletion example/esm.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h1>ESM Demo</h1>
<script type="module">
import { AddressFinder } from "../dist/address-finder.esm.js";
AddressFinder.setup({
apiKey: window.apiKey || "iddqd",
apiKey: window.apiKey || "ak_test",
inputField: "#line_1",
outputFields: {
line_1: "#line_1",
Expand Down
2 changes: 1 addition & 1 deletion example/ie11.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h1>Browser Demo</h1>
<input type="text" id="postcode" />
<script>
IdealPostcodes.AddressFinder.setup({
apiKey: window.apiKey || "iddqd",
apiKey: window.apiKey || "ak_test",
inputField: "#line_1",
outputFields: {
line_1: "#line_1",
Expand Down
Loading

0 comments on commit e477a89

Please sign in to comment.